Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

FindReplace tests fail when run as part of the unit test suite #5094

Closed
dangoor opened this issue Sep 6, 2013 · 8 comments
Closed

FindReplace tests fail when run as part of the unit test suite #5094

dangoor opened this issue Sep 6, 2013 · 8 comments
Assignees
Milestone

Comments

@dangoor
Copy link
Contributor

dangoor commented Sep 6, 2013

On my Mac, I see a consistent failure of 11 FindReplace unit tests only when the whole unit test suite is run. If FindReplace is run by itself, the tests all pass.

@jasonsanjose
Copy link
Member

cc @njx

I found that the test should Find Next after search bar closed, including wraparound is waiting for the modal bar to disappear in waitsForSearchBarClose but it never does.

The reason it was never removed from the DOM is because ModalBar waits for webkitTransitionEnd on the modal-bar-hide animation before removing it from the DOM. This doesn't happen because the actual style rule defined in brackets.less isn't actually included in the SpecRunner.html.

I'm not sure how these tests are passing on the build machine at all. That's just weird.

Anyhow, just dropping in brackets.less into SpecRunner.html won't work since that will break the runner UI.

@njx
Copy link
Contributor

njx commented Sep 12, 2013

It's weird because I haven't seen that test fail when running the whole suite. But the cause you mentioned makes sense. Assigning to me.

@ghost ghost assigned njx Sep 12, 2013
@njx
Copy link
Contributor

njx commented Sep 13, 2013

Ah, I can see some failures if I run every test (not just the ones in the "Unit" list), although I only see 3. I don't understand why it doesn't always fail.

@njx
Copy link
Contributor

njx commented Sep 13, 2013

Aha! It turns out that (1) webkitTransitionEnd bubbles (which is weird) and (2) in Bootstrap, input controls have various transitions set on them which fire on focus change; the input field in the Find bar appears to be the one triggering the transition end. That still doesn't explain why we sometimes get the event and sometimes don't, but it at least explains why it often doesn't fail.

(As an aside, it seems like our focus event in Brackets doesn't have the transition, so we get "lucky" that we don't accidentally respond to a transitionEnd event. The lesson is probably that we should always be checking the target of a transitionEnd to make sure it's the thing we think is transitioning.)

Haven't figured out the best way to fix this yet. We've had at least one other case where not having the "real" CSS when running tests has bitten us (in that case, it was that we had a class where Bootstrap set it to display: block when we set it to display: none). In general, in cases where CSS has real effects on the functionality that we test for (e.g. whether something is visible or not, or when functionality depends on a transition), we're susceptible to this issue.

@njx
Copy link
Contributor

njx commented Sep 13, 2013

Adding to this sprint.

@redmunds
Copy link
Contributor

Is the problem related to the undesired transitions after clicking "Yes" or "No" buttons? If so, then maybe fixing #5168 will also fix the bugs.

@njx
Copy link
Contributor

njx commented Sep 13, 2013

No, it's an issue with any transition, not just those.

@redmunds
Copy link
Contributor

Not sure when @dangoor will be back, so proactively closing this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants