-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(pagination): prevent focus of disabled selectors #1114
Conversation
8e0c465
to
dee77c1
Compare
@@ -27,10 +27,16 @@ function expectPages(nativeEl: HTMLElement, pagesDef: string[]): void { | |||
expect(pages[i]).not.toHaveCssClass('active'); | |||
expect(pages[i]).toHaveCssClass('disabled'); | |||
expect(normalizeText(pages[i].textContent)).toEqual(pageDef.substr(1)); | |||
if (normalizeText(pages[i].textContent) !== '...') { |
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.
I did this to put the check in for all checkPages() calls. If you want me to break this out into a separate test I can.
} else { | ||
expect(pages[i]).not.toHaveCssClass('active'); | ||
expect(pages[i]).not.toHaveCssClass('disabled'); | ||
expect(normalizeText(pages[i].textContent)).toEqual(pageDef); | ||
if (normalizeText(pages[i].textContent) !== '...') { | ||
expect(pages[i].querySelector('a').getAttribute('tabindex')).not.toEqual('-1'); |
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.
maybe expect(pages[i].querySelector('a').hasAttribute('tabindex')).toBeFalsy()
?
I think we're expecting that attribute should not be there at all
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.
Sounds good, will do.
dee77c1
to
dea7032
Compare
Not sure why travis failed. Maybe it needs to be restarted? I think a saucelabs issue. |
Fixes #1108