modal tests to visibilitychange