vue-typeahead-bootstrap
Advanced tools
Comparing version 2.9.0 to 2.10.0
@@ -0,1 +1,4 @@ | ||
## 2.10.0 - 5 Apr 2021 | ||
- Provide for customizable screen reader text | ||
## 2.9.0 - 5 Apr 2021 | ||
@@ -2,0 +5,0 @@ - Support 'enter' selecting the first item of the list |
{ | ||
"name": "vue-typeahead-bootstrap", | ||
"version": "2.9.0", | ||
"version": "2.10.0", | ||
"private": false, | ||
@@ -34,3 +34,3 @@ "description": "A typeahead/autocomplete component for Vue 2 using Bootstrap 4", | ||
"test:unit:watch": "vue-cli-service test:unit --watch", | ||
"test:debug": "node --inspect ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit --runInBand --no-cache --watch" | ||
"test:debug": "echo '\n\n\n\n*******\n*****************\nlaunch chrome://inspect!!!!!!\n****************\n******\n\n\n\n\n';sleep 5;node --inspect ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit --runInBand --no-cache --watch" | ||
}, | ||
@@ -37,0 +37,0 @@ "dependencies": { |
@@ -193,2 +193,51 @@ import { mount } from '@vue/test-utils' | ||
it('Highlights text matches correctly when the query contains accents and the data does not', async () => { | ||
wrapper.setProps({ | ||
data: [ | ||
{ | ||
id: 0, | ||
data: 'amelie', | ||
text: 'amelie' | ||
} | ||
], | ||
query: 'amé' | ||
}) | ||
await wrapper.vm.$nextTick() | ||
expect(wrapper.findComponent(VueTypeaheadBootstrapListItem).vm.htmlText).toBe(`<span class='vbt-matched-text'>ame</span>lie`) | ||
}) | ||
describe('providing accessible text for screen readers', () => { | ||
it('renders screen reader text if provided', async () => { | ||
wrapper.setProps({ | ||
data: [ | ||
{ | ||
id: 0, | ||
data: 'Canada', | ||
text: 'Canada', | ||
screenReaderText: 'my screen reader text', | ||
} | ||
], | ||
query: 'Can' | ||
}) | ||
await wrapper.vm.$nextTick() | ||
console.log(wrapper.findComponent(VueTypeaheadBootstrapListItem).vm.screenReaderText) | ||
expect(wrapper.findComponent(VueTypeaheadBootstrapListItem).vm.screenReaderText).toBe('my screen reader text') | ||
}) | ||
it("defaults the screen reader text to the item's text if not provided ", async () => { | ||
wrapper.setProps({ | ||
data: [ | ||
{ | ||
id: 0, | ||
data: 'Canada', | ||
text: 'Canada' | ||
}, | ||
], | ||
query: 'Can' | ||
}) | ||
await wrapper.vm.$nextTick() | ||
expect(wrapper.findComponent(VueTypeaheadBootstrapListItem).vm.screenReaderText).toBe('Canada') | ||
}) | ||
}) | ||
describe('selecting items with the keyboard', () => { | ||
@@ -195,0 +244,0 @@ beforeEach(() => { |
Sorry, the diff of this file is not supported yet
1793228
17729