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(pagination): prevent focus of disabled selectors #1114

Closed
wants to merge 1 commit into from

Conversation

deeg
Copy link
Contributor

@deeg deeg commented Dec 5, 2016

Fixes #1108

deeg added a commit to deeg/ng-bootstrap that referenced this pull request Dec 5, 2016
@@ -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) !== '...') {
Copy link
Contributor Author

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');
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, will do.

@deeg
Copy link
Contributor Author

deeg commented Dec 9, 2016

Not sure why travis failed. Maybe it needs to be restarted? I think a saucelabs issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants