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

🐛 [Story attachment] Opening outlink error for closeButton being null #37833

Merged
merged 19 commits into from
Mar 8, 2022

Conversation

mszylkowski
Copy link
Contributor

Fixes ampproject/error-reporting#147

Outlinks when opened don't have a closeButton that they can change the tabindex so it was throwing an error. By checking if there's such button we can prevent the error and run the last lines of the open() method properly.

@mszylkowski mszylkowski self-assigned this Mar 8, 2022
@amp-owners-bot
Copy link

amp-owners-bot bot commented Mar 8, 2022

Hey @gmajoulet, @newmuis! These files were changed:

extensions/amp-story-page-attachment/0.1/amp-story-page-attachment.js
extensions/amp-story-page-attachment/0.1/test/test-amp-story-page-attachment.js

Copy link
Member

@calebcordry calebcordry left a comment

Choose a reason for hiding this comment

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

Can we add a test?

@mszylkowski
Copy link
Contributor Author

For sure, I think in general the feature is undertested but any unit test that checks this functionality should have picked it up. I'll add a generic test for the outlink component that would have caught this error (and potentially many other ones like it).

@mszylkowski mszylkowski removed the request for review from processprocess March 8, 2022 19:19
Copy link
Member

@calebcordry calebcordry left a comment

Choose a reason for hiding this comment

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

Thanks for adding tests!

@mszylkowski mszylkowski enabled auto-merge (squash) March 8, 2022 19:27
@mszylkowski mszylkowski merged commit 435c185 into ampproject:main Mar 8, 2022
@mszylkowski mszylkowski deleted the openoutlink_error branch March 8, 2022 19:46
@processprocess
Copy link
Contributor

Thank you for fixing this & writing a test for it ❤️

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.

🚨 Error: Cannot read properties of null (reading 'setAttribute')
4 participants