File tree Expand file tree Collapse file tree
src/tests/views/FilesList Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,11 +127,6 @@ describe('FilesList.vue rendering rules', () => {
127127 mocks : {
128128 $route : routeMock ,
129129 } ,
130- stubs : {
131- ListViewIcon : {
132- template : '<i class="list-view-icon" />' ,
133- } ,
134- } ,
135130 } ,
136131 } )
137132 }
@@ -145,6 +140,7 @@ describe('FilesList.vue rendering rules', () => {
145140
146141 expect ( wrapper . vm . mdiFolder ) . toBeTruthy ( )
147142 expect ( wrapper . vm . mdiViewGrid ) . toBeTruthy ( )
143+ expect ( wrapper . vm . mdiViewList ) . toBeTruthy ( )
148144 } )
149145
150146 it ( 'shows empty-state request action when user can request sign' , async ( ) => {
@@ -193,4 +189,17 @@ describe('FilesList.vue rendering rules', () => {
193189 const iconWithPath = wrapper . findAll ( '.nc-icon' ) . find ( ( node ) => ! ! node . attributes ( 'data-path' ) )
194190 expect ( iconWithPath ?. attributes ( 'data-path' ) ) . toBe ( wrapper . vm . mdiViewGrid )
195191 } )
192+
193+ it ( 'renders list toggle icon path when in grid mode' , async ( ) => {
194+ const filesStore = useFilesStore ( )
195+ const userConfigStore = useUserConfigStore ( )
196+ vi . spyOn ( filesStore , 'getAllFiles' ) . mockResolvedValue ( { } )
197+ userConfigStore . files_list_grid_view = true
198+
199+ const wrapper = mountComponent ( )
200+ await flushPromises ( )
201+
202+ const iconWithPath = wrapper . findAll ( '.nc-icon' ) . find ( ( node ) => ! ! node . attributes ( 'data-path' ) )
203+ expect ( iconWithPath ?. attributes ( 'data-path' ) ) . toBe ( wrapper . vm . mdiViewList )
204+ } )
196205} )
You can’t perform that action at this time.
0 commit comments