@@ -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