Commit Graph

11 Commits

Author SHA1 Message Date
Tom Byers
cf07d79024 Make difference between table frames obvious
...by naming the attributes related to
accessibility.

Also includes tests for this.
2020-09-23 10:33:58 +01:00
Tom Byers
a9c1d64326 Add tests for the focus style & new attributes 2020-09-19 22:03:45 +01:00
Tom Byers
2b5ba5f438 Use screenMock helper in fullscreenTable test 2019-11-08 17:37:06 +00:00
Tom Byers
56a2aab5f0 Mock out getClientRects for tests that need it
jQuery 3 calls `getClientRects` in the
`.innerHeight` code. Version 1 didn't.

This mocks out those calls to the same as
`getCoundingClientRect`.
2019-11-08 17:37:06 +00:00
Tom Byers
9d176d8d8d Merge pull request #3093 from alphagov/fix-aria-on-fullscreen-table
Change method of hiding extra table layer
2019-08-29 14:01:54 +01:00
Tom Byers
13c40a25d1 Changes to WindowMock helper
This includes the following fixes:

1. fix error in `WindowMock.setWidthTo`

   It was returning height, not width.

2. Fix for `WindowMock.reset`

   Changes to the scroll position need to go
   through the `scrollTo` method.

It also includes the following changes

1. Improve mocking of window scrollTop

   Increases the number of DOM API methods mocked
   to return the intended scrollTop value.

2. Change WindowMock.scrollBy to
   WindowMock.scrollTo

   Because you're not scrolling by an amount,
   you're scrolling to a position.

3. Give WindowMock getters for position/dimension

   It's useful to be able to get the
   position/dimension of the window in tests when
   you're resizing and scrolling it as part of the
   test.

4. Assign WindowMock spies on instantiation

   Assigning them whenever a dimension is set doesn't
   make sense. You're just setting a value, not
   changing how that value is accessed.
2019-08-22 15:12:43 +01:00
Tom Byers
92626c3f41 Change method of hiding extra table layer
This module creates a clone of the existing table
as an extra layer which sits on top of it.

This allows the row headers to sit above the table
content when it scrolls.

We were setting `role=presentation` on the extra
table to hide it from assistive technologies.

It seems that this wasn't working. From the spec'
`role-presentation` should remove the semantics of
the table but leave the content.

Testing in Safari, with the OSX Accessibility
Inspector, this isn't happening and the table is
still being reported as a table by the
accessibility API.

This changes to the `aria-hidden` attribute, to
make sure the extra table is ignored.
2019-08-16 16:23:29 +01:00
Tom Byers
1a5d40312a Move window mock functions into helper class 2019-06-12 16:03:35 +01:00
Tom Byers
1082a37750 Update call out to sticky JS, with test for it 2019-06-12 16:03:26 +01:00
Tom Byers
0131f0c1b1 Move setup/teardown out of tests 2019-06-12 16:03:18 +01:00
Tom Byers
435334ba9c Add tests for full-screen table module 2019-06-12 16:03:09 +01:00