Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[amp-story] Stop stubbing querySelectorAll in tests 馃悰 #19718

Merged
merged 2 commits into from Dec 7, 2018

Conversation

Enriqe
Copy link
Contributor

@Enriqe Enriqe commented Dec 7, 2018

Fixes #19716

Stubbing querySelectorAll in the amp-story element was causing the tests to break.

When deleting the element from the DOM in the afterEach hook, the custom-elements polyfill will use the element's querySelectAll to disconnect that node and its children. This just started breaking because of a recent change which forces installation of the custom-elements.js v1 polyfill.

@Enriqe Enriqe self-assigned this Dec 7, 2018
@Enriqe Enriqe changed the title [amp-story] Fix tests 馃悰 [amp-story] Stop stubbing querySelectorAll in tests 馃悰 Dec 7, 2018

const expected = {
[MediaType.AUDIO]: 3,
[MediaType.VIDEO]: 4,
[MediaType.VIDEO]: 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what's going on here, but why does the expected number of max videos in the pool decrease with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because the test was faking that there were two amp-video elements, and I only appended one to make the test look cleaner. But let me know if you think it's better to keep as it was and append two amp-videos.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks for the explanation. Agree this makes it easier to read.

@gmajoulet gmajoulet merged commit d231440 into ampproject:master Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants