Add unit test for jQuery tabs plugin #876

Merged
merged 1 commit into from Jan 6, 2017

Projects

None yet

2 participants

@fofr
Member
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

@fofr fofr Add unit test for jQuery tabs plugin
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
36caa1a
@fofr
Member
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 View changes
@fofr fofr merged commit c2be16c into master Jan 6, 2017

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