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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests for amp-viewer-integration #32937

Merged
merged 12 commits into from Feb 26, 2021

Conversation

dmanek
Copy link
Contributor

@dmanek dmanek commented Feb 25, 2021

  1. Fix skipped tests
  2. Update tests to work with current version of sinon.js
  3. Address outstanding TODOs

Fixes #32938

@dmanek dmanek marked this pull request as ready for review February 25, 2021 22:32
Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

Thank you!

const event = {
source: window,
source: env.win,
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this change. It prevents the pollution of the global window object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏽

const ampDocSrc = '/test/fixtures/served/ampdoc-with-messaging.html';
// TODO(aghassemi): Investigate failure in beforeEach. #10974.
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a failure in the beforeEach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, not sure why this was skipped (issue #10974 doesn't offer much context).

However, while looking into this, I discovered that 'should handle unload correctly' test was incorrect and got a chance to fix it & move it to the correct location since it is testing AmpViewerIntegration. So thanks for this comment!

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.

[amp-viewer-integration] Fix unit tests
4 participants