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
Add Inabox integration test #19711
Add Inabox integration test #19711
Conversation
scrolling="no" | ||
width="300" height="250"> | ||
</iframe> | ||
<script src="/examples/inabox-tag-integration.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(low-key watching this PR because I'm looking to take advantage of it)
You may already be aware of this issue (if so sorry!), but due to #9120 the iframe will attempt to get visibility information from the top level window, but since in Karma the top-level window is not the test fixture with the host script loaded, the message will be discarded without results. The test would still pass on browsers that didn't need the host script in the first place, but it fails on Safari due to lacking IntersectionObserver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zombifier Thanks for catching this! We actually have our own IntersectionObserver polyfill for Safari, so this test may still work 😄
I'll let @lannka Make the final decision though, as they are more familiar with this than I am.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zombifier that's a good observation, that might be the cause of the Safari failing. I haven't looked into it yet (was OOO for a couple of days). Will update this thread once I figured out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄 Just one small requested change.
test/integration/test-amp-inabox.js
Outdated
expect(Date.now()).to.be.below(scrollTime); | ||
expect(req.url).to.equal('/foo?cid='); | ||
}); | ||
const analPromise = RequestBank.withdraw('analytics').then(req => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this variable? I don't think people will think analytics
from this shorthand 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, that's indeed a big mistake (after reading it to myself twice)
Unfortunately the BTF test is blocked by the other bug: #14010 . inabox visible trigger is not working in nested iframes. |
To unblock this PR, removed the BTF test. Added a TODO to add it back once #14010 is fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄
* Add integration test for amp-inabox * add test for ATF * rename * fix test. * remove BTF test * revert some unnecessary changes
Closes #19710