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

Add unit test for jQuery tabs plugin #876

Merged
merged 1 commit into from Jan 6, 2017
Merged

Add unit test for jQuery tabs plugin #876

merged 1 commit into from Jan 6, 2017

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Jan 6, 2017

This is not an exhaustive test. It tests the fundamental behaviour of the app in its two modes; accordion and tabs.

It aims to test that the jQuery tabs plugin:

  • Runs set up code without error
  • Configures tab links and panes
  • Hides and shows panes when clicking links

The lack of a unit test meant we missed an error produced when jQuery was upgraded:
#874
jquery/jquery#2824

When upgrading jQuery again, this test will fail with the error:

Error: Syntax error, unrecognized expression: a[href$=#]

cc @nickcolley @gpeng

This is not an exhaustive test. It tests the fundamental behaviour of
the app in its two modes; accordion and tabs.

* Runs set up code without error
* Configures tab links and panes
* Hides and shows panes when clicking links
@fofr
Copy link
Contributor Author

@fofr fofr commented Jan 6, 2017

When writing this test I noticed that the aria attributes it generates eg aria-controls and aria-labelledby don't appear to take into account that the plugin itself is altering the ID of tab pane elements (it appends -enhanced). I believe this means the aria attributes on tabs will be pointing at an element ID that does not exist on the page, making the tabs inaccessible.

@cfq can we test this?

@gpeng
gpeng approved these changes Jan 6, 2017
@fofr fofr merged commit c2be16c into master Jan 6, 2017
1 check passed
1 check passed
default "Build #1392 succeeded on Jenkins"
Details
@fofr fofr deleted the fix-incorrect-selector branch Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.