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 @@ -74,7 +74,17 @@ vi.mock('@nextcloud/vue/components/NcAppContent', () => ({
7474 default : { name : 'NcAppContent' , template : '<div><slot /></div>' } ,
7575} ) )
7676vi . mock ( '@nextcloud/vue/components/NcBreadcrumb' , ( ) => ( {
77- default : { name : 'NcBreadcrumb' , template : '<div><slot name="icon" /></div>' } ,
77+ default : {
78+ name : 'NcBreadcrumb' ,
79+ template : '<div><slot name="icon" /><slot name="menu-icon" /><slot /></div>' ,
80+ } ,
81+ } ) )
82+ vi . mock ( '@nextcloud/vue/components/NcActionButton' , ( ) => ( {
83+ default : {
84+ name : 'NcActionButton' ,
85+ emits : [ 'click' ] ,
86+ template : '<button class="nc-action-button-stub" @click="$emit(\'click\')"><slot /></button>' ,
87+ } ,
7888} ) )
7989vi . mock ( '@nextcloud/vue/components/NcBreadcrumbs' , ( ) => ( {
8090 default : { name : 'NcBreadcrumbs' , template : '<div><slot /><slot name="actions" /></div>' } ,
@@ -193,7 +203,8 @@ describe('FilesList.vue rendering rules', () => {
193203 const wrapper = mountComponent ( )
194204 await flushPromises ( )
195205
196- const iconWithPath = wrapper . findAll ( '.nc-icon' ) . find ( ( node ) => ! ! node . attributes ( 'data-path' ) )
206+ const gridButton = wrapper . find ( '.files-list__header-grid-button' )
207+ const iconWithPath = gridButton . findAll ( '.nc-icon' ) . find ( ( node ) => ! ! node . attributes ( 'data-path' ) )
197208 expect ( iconWithPath ?. attributes ( 'data-path' ) ) . toBe ( wrapper . vm . mdiViewGrid )
198209 } )
199210
You can’t perform that action at this time.
0 commit comments