8000 Update table-filtering.spec.js · bootstrap-vue/bootstrap-vue@d79a2fd · GitHub
[go: up one dir, main page]

Skip to content

Commit d79a2fd

Browse files
committed
Update table-filtering.spec.js
1 parent 3e3ea3c commit d79a2fd

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/components/table/table-filtering.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,34 @@ describe('table > filtering', () => {
207207
wrapper.destroy()
208208
})
209209

210+
it('should filter for formatted values for keys which are not present in row', async () => {
211+
const wrapper = mount(BTable, {
212+
propsData: {
213+
items: [{ a: 'A', b: 'B' }],
214+
fields: [
215+
{ key: 'a' },
216+
{
217+
key: 'b',
218+
formatter: () => 'Foo',
219+
filterByFormatted: true
220+
},
221+
{
222+
key: 'c',
223+
formatter: () => 'Bar',
224+
filterByFormatted: true
225+
}
226+
],
227+
filter: 'Bar'
228+
}
229+
})
230+
expect(wrapper).toBeDefined()
231+
await waitNT(wrapper.vm)
232+
233+
expect(wrapper.findAll('tbody > tr').length).toBe(1)
234+
235+
wrapper.destroy()
236+
})
237+
210238
it('should show empty filtered message when no matches and show-empty=true', async () => {
211239
const wrapper = mount(BTable, {
212240
propsData: {

0 commit comments

Comments
 (0)
0