This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add aria-disabled, aris-busy to listbox
- Loading branch information
Ernest
committed
Jun 6, 2021
1 parent
63f7631
commit 25d51b4
Showing
8 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
cypress/integration/behavior/a11y/role/listbox/disabled.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link | ||
type="text/css" | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" | ||
/> | ||
<link type="text/css" rel="stylesheet" href="/dist/index.css" /> | ||
<script src="https://unpkg.com/vue@next/dist/vue.global.prod.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script src="/dist/vue-next-select.iife.js"></script> | ||
<script> | ||
const { ref, createApp } = Vue | ||
|
||
const app = createApp({ | ||
name: 'app', | ||
setup() { | ||
const selectedOptions = null | ||
const options = ref(['i', 'love', 'vue']) | ||
|
||
return { | ||
selectedOptions, | ||
options, | ||
} | ||
}, | ||
template: ` | ||
<vue-select | ||
v-model="selectedOptions" | ||
:options="options" | ||
disabled | ||
></vue-select> | ||
`, | ||
}) | ||
|
||
app.component('vue-select', VueNextSelect) | ||
app.mount(document.querySelector('#app')) | ||
</script> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
cypress/integration/behavior/a11y/role/listbox/disabled.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="cypress" /> | ||
import path from 'path' | ||
|
||
context('listbox', () => { | ||
// https://www.w3.org/TR/wai-aria-1.1/#listbox | ||
|
||
it('should set aria-busy to true when disabled options', () => { | ||
cy.visit(path.join(__dirname, 'disabled.html')) | ||
|
||
cy.get('[id="vs1-listbox"]').should('have.attr', 'aria-disabled', 'true') | ||
}) | ||
}) |
44 changes: 44 additions & 0 deletions
44
cypress/integration/behavior/a11y/role/listbox/loading.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link | ||
type="text/css" | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" | ||
/> | ||
<link type="text/css" rel="stylesheet" href="/dist/index.css" /> | ||
<script src="https://unpkg.com/vue@next/dist/vue.global.prod.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script src="/dist/vue-next-select.iife.js"></script> | ||
<script> | ||
const { ref, createApp } = Vue | ||
|
||
const app = createApp({ | ||
name: 'app', | ||
setup() { | ||
const selectedOptions = null | ||
const options = ref(['i', 'love', 'vue']) | ||
|
||
return { | ||
selectedOptions, | ||
options, | ||
} | ||
}, | ||
template: ` | ||
<vue-select | ||
v-model="selectedOptions" | ||
:options="options" | ||
loading | ||
></vue-select> | ||
`, | ||
}) | ||
|
||
app.component('vue-select', VueNextSelect) | ||
app.mount(document.querySelector('#app')) | ||
</script> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
cypress/integration/behavior/a11y/role/listbox/loading.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="cypress" /> | ||
import path from 'path' | ||
|
||
context('listbox', () => { | ||
// https://www.w3.org/TR/wai-aria-1.1/#listbox | ||
|
||
it('should set aria-busy to true when loading options', () => { | ||
cy.visit(path.join(__dirname, 'loading.html')) | ||
|
||
cy.get('[id="vs1-listbox"]').should('have.attr', 'aria-busy', 'true') | ||
}) | ||
}) |
44 changes: 44 additions & 0 deletions
44
cypress/integration/behavior/a11y/role/listbox/multiple.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link | ||
type="text/css" | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" | ||
/> | ||
<link type="text/css" rel="stylesheet" href="/dist/index.css" /> | ||
<script src="https://unpkg.com/vue@next/dist/vue.global.prod.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script src="/dist/vue-next-select.iife.js"></script> | ||
<script> | ||
const { ref, createApp } = Vue | ||
|
||
const app = createApp({ | ||
name: 'app', | ||
setup() { | ||
const selectedOptions = ref([]) | ||
const options = ref(['i', 'love', 'vue']) | ||
|
||
return { | ||
selectedOptions, | ||
options, | ||
} | ||
}, | ||
template: ` | ||
<vue-select | ||
v-model="selectedOptions" | ||
:options="options" | ||
multiple | ||
></vue-select> | ||
`, | ||
}) | ||
|
||
app.component('vue-select', VueNextSelect) | ||
app.mount(document.querySelector('#app')) | ||
</script> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
cypress/integration/behavior/a11y/role/listbox/mutiple.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference types="cypress" /> | ||
import path from 'path' | ||
|
||
context('listbox', () => { | ||
// https://www.w3.org/TR/wai-aria-1.1/#listbox | ||
|
||
it('should set aria-multiselectable to true when multiple options can be selected', () => { | ||
cy.visit(path.join(__dirname, 'multiple.html')) | ||
|
||
cy.get('[id="vs1-listbox"]').should('have.attr', 'aria-multiselectable', 'true') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters