Skip to content

Commit eaad896

Browse files
authored
test: Update failing tests (#15)
- Fix `skip-to-list` demo label text - Use tab to select skip-links - Add test for main link label
1 parent 70853b3 commit eaad896

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

demo/skip-to-list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div id="app">
2121
<!-- data-vst used for internal testing, it is NOT required -->
2222
<vue-skip-to
23-
title-list="Skip to"
23+
title-list="Skip links"
2424
:to="[
2525
{ anchor: '#main', label: 'Main content' },
2626
{ anchor: '#footer', label: 'Footer' },

tests/e2e/integration/skip-to-list.js

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ describe('Skip link list', () => {
1010
})
1111

1212
it('Should traverse links on tab', () => {
13+
cy.get('body').tab()
14+
cy.focused().should('contain', 'Main')
15+
1316
cy.get('body').tab().tab()
1417
cy.focused().should('contain', 'Footer')
1518
})

tests/e2e/integration/skip-to.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Skip to main content', () => {
1313
})
1414

1515
it('Checks if destination is receiving focus', () => {
16-
cy.get('[data-vst="skip-to"]').focus().click()
16+
cy.get('body').tab().click()
1717
cy.focused().should('have.id', 'main')
1818
})
1919
})
@@ -33,7 +33,7 @@ describe('Skip to search', () => {
3333
})
3434

3535
it('The input search must receive the focus', () => {
36-
cy.get('[data-vst="skip-to"]').focus().click()
36+
cy.get('body').tab().click()
3737
cy.focused().should('have.id', 'search')
3838
})
3939
})

0 commit comments

Comments
 (0)