File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,25 @@ describe('LaravelVuePagination', function() {
72
72
expect ( wrapper . findAll ( 'li' ) . at ( 0 ) . element . classList ) . toContain ( 'active' ) ;
73
73
} ) ;
74
74
75
+ it ( 'shows disabled links' , function ( ) {
76
+ const wrapper = getComponent ( LaravelVuePagination , {
77
+ data : exampleData ,
78
+ showDisabled : true ,
79
+ } ) ;
80
+ expect ( wrapper . findAll ( 'li' ) . at ( 0 ) . element . classList ) . toContain ( 'disabled' ) ;
81
+ expect ( wrapper . findAll ( 'a' ) . at ( 0 ) . element . tabIndex ) . toBe ( - 1 ) ;
82
+ expect ( wrapper . findAll ( '.disabled' ) . length ) . toEqual ( 1 ) ;
83
+ } ) ;
84
+
85
+ it ( 'does not show disabled links' , function ( ) {
86
+ const wrapper = getComponent ( LaravelVuePagination , {
87
+ data : exampleData ,
88
+ } ) ;
89
+ expect ( wrapper . findAll ( 'li' ) . at ( 0 ) . element . classList ) . not . toContain ( 'disabled' ) ;
90
+ expect ( wrapper . findAll ( 'a' ) . at ( 0 ) . element . tabIndex ) . toBe ( 0 ) ;
91
+ expect ( wrapper . findAll ( '.disabled' ) . length ) . toEqual ( 0 ) ;
92
+ } ) ;
93
+
75
94
it ( 'has correct DOM structure with -1 limit on page 2' , function ( ) {
76
95
exampleData . current_page = 2 ;
77
96
exampleData . next_page_url = 'http://example.com/page/3' ;
You can’t perform that action at this time.
0 commit comments