Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d658b2

Browse filesBrowse files
committed
test: CDataTable tests update
1 parent c94cb09 commit 4d658b2
Copy full SHA for 4d658b2

File tree

1 file changed

+19
-6
lines changed
Filter options

1 file changed

+19
-6
lines changed

‎src/components/table/tests/CDataTable.spec.js

Copy file name to clipboardExpand all lines: src/components/table/tests/CDataTable.spec.js
+19-6Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ function createCustomWrapper () {
4646
footer: true,
4747
sorterValue: { column: 'username', asc: false },
4848
columnFilterValue: { registered: '2', 'non_existing': 'smh' },
49-
pagination: true,
50-
noItemsView: { noResults: 'no results text', noItems: 'no items text'}
49+
pagination: true
5150
},
5251
slots: {
5352
details: '<div class="details">Details slot</div>'
@@ -114,13 +113,13 @@ describe(ComponentName, () => {
114113
it('updates column filter on events depending on lazy modifier', () => {
115114
const localWrapper = createCustomWrapper()
116115
const input = localWrapper.findAll('tr').at(1).find('input')
117-
const updateEmmited = () => localWrapper.emitted()['update:column-filter-value']
116+
const updateEmitted = () => localWrapper.emitted()['update:column-filter-value']
118117
localWrapper.setProps({ columnFilter: { lazy: true } })
119118
input.trigger('input')
120-
expect(updateEmmited()).not.toBeTruthy()
119+
expect(updateEmitted()).not.toBeTruthy()
121120
localWrapper.setProps({ columnFilter: true })
122121
input.trigger('input')
123-
expect(updateEmmited()).toBeTruthy()
122+
expect(updateEmitted()).toBeTruthy()
124123
})
125124
it('updates table filter on events depending on lazy modifier', () => {
126125
const localWrapper = createCustomWrapper()
@@ -195,15 +194,29 @@ describe(ComponentName, () => {
195194
expect(localWrapper.vm.paginationSelect.label).toBe('new label')
196195
expect(localWrapper.vm.paginationSelect.values[1]).toBe(25)
197196
})
198-
it('Properly sets no items view from prop', () => {
197+
it('Properly sets no items view text', () => {
199198
const localWrapper = createCustomWrapper()
200199
localWrapper.setProps({
201200
tableFilterValue: '12322'
202201
})
202+
expect(localWrapper.text()).toContain('No filtering results')
203+
localWrapper.setProps({
204+
noItemsView: {
205+
noResults: 'no results text'
206+
}
207+
})
203208
expect(localWrapper.text()).toContain('no results text')
209+
210+
204211
localWrapper.setProps({
205212
items: []
206213
})
214+
expect(localWrapper.text()).toContain('No items')
215+
localWrapper.setProps({
216+
noItemsView: {
217+
noItems: 'no items text'
218+
}
219+
})
207220
expect(localWrapper.text()).toContain('no items text')
208221
})
209222
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.