-
Notifications
You must be signed in to change notification settings - Fork 10
fix: cover edge cases for anchor tags #139
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
Conversation
Pull Request Test Coverage Report for Build 13433032158Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 13414773993Details
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 13414773993Details
💛 - Coveralls |
| it('should validate anchor with static href value', () => { | ||
| expect(validateHTML({ validAnchor: '<a href="http://localhost">foo</a>' }, 'test', true)).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| it('should validate anchor with interpolated href value', () => { | ||
| expect( | ||
| validateHTML({ validAnchor: '<a href="%(googlePrivacyUrl)s">Règles de confidentialité</a>' }, 'test', true), | ||
| ).toMatchSnapshot(); | ||
| }); |
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.
results are empty arrays, maybe we don't need snapshot
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.
Yeah, I tried to keep the same structure as the test above, to have some consistency, but maybe I can just have it check the error object to be false
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.
Changed it to check for the array lenght to be zero
Why?
At bedrock we want to add translations with a static href value and the current linter never captures the open anchor tag.
eg: 'some link' will fail because it won't have a open tag captured
How?
Add a second capture group just for this case