11import * as InitialState from '@nextcloud/initial-state'
22import * as L10n from '@nextcloud/l10n'
3- import FolderSvg from '@mdi/svg/svg/folder.svg'
4- import ShareSvg from '@mdi/svg/svg/share-variant.svg'
3+ // eslint-disable-next-line import/no-unresolved
4+ import FolderSvg from '@mdi/svg/svg/folder.svg?raw'
5+ // eslint-disable-next-line import/no-unresolved
6+ import ShareSvg from '@mdi/svg/svg/share-variant.svg?raw'
57import { createTestingPinia } from '@pinia/testing'
68
7- import NavigationService from '../services/Navigation.ts '
9+ import NavigationService from '../services/Navigation'
810import NavigationView from './Navigation.vue'
911import router from '../router/router.js'
1012import { useViewConfigStore } from '../store/viewConfig'
13+ import { Folder } from '@nextcloud/files'
1114
1215describe ( 'Navigation renders' , ( ) => {
1316 const Navigation = new NavigationService ( ) as NavigationService
1417
1518 before ( ( ) => {
1619 cy . stub ( InitialState , 'loadState' )
1720 . returns ( {
18- used : 1000 * 1000 * 1000 ,
21+ used : 1024 * 1024 * 1024 ,
1922 quota : - 1 ,
2023 } )
2124 } )
@@ -72,7 +75,7 @@ describe('Navigation API', () => {
7275 Navigation . register ( {
7376 id : 'sharing' ,
7477 name : 'Sharing' ,
75- getContents : ( ) => Promise . resolve ( ) ,
78+ getContents : ( ) => Promise . resolve ( { contents : [ ] , folder : new Folder ( { owner : 'admin' , source : 'source' } ) } ) ,
7679 icon : ShareSvg ,
7780 order : 2 ,
7881 } )
@@ -99,7 +102,7 @@ describe('Navigation API', () => {
99102 Navigation . register ( {
100103 id : 'sharingin' ,
101104 name : 'Shared with me' ,
102- getContents : ( ) => Promise . resolve ( ) ,
105+ getContents : ( ) => Promise . resolve ( { contents : [ ] , folder : new Folder ( { owner : 'admin' , source : 'source' } ) } ) ,
103106 parent : 'sharing' ,
104107 icon : ShareSvg ,
105108 order : 1 ,
@@ -146,7 +149,7 @@ describe('Navigation API', () => {
146149 Navigation . register ( {
147150 id : 'files' ,
148151 name : 'Files' ,
149- getContents : ( ) => Promise . resolve ( ) ,
152+ getContents : ( ) => Promise . resolve ( { contents : [ ] , folder : new Folder ( { owner : 'admin' , source : 'source' } ) } ) ,
150153 icon : FolderSvg ,
151154 order : 1 ,
152155 } )
@@ -191,7 +194,7 @@ describe('Quota rendering', () => {
191194 cy . stub ( InitialState , 'loadState' )
192195 . as ( 'loadStateStats' )
193196 . returns ( {
194- used : 1000 * 1000 * 1000 ,
197+ used : 1024 * 1024 * 1024 ,
195198 quota : - 1 ,
196199 } )
197200
@@ -215,8 +218,8 @@ describe('Quota rendering', () => {
215218 cy . stub ( InitialState , 'loadState' )
216219 . as ( 'loadStateStats' )
217220 . returns ( {
218- used : 1000 * 1000 * 1000 ,
219- quota : 5 * 1000 * 1000 * 1000 ,
221+ used : 1024 * 1024 * 1024 ,
222+ quota : 5 * 1024 * 1024 * 1024 ,
220223 relative : 20 , // percent
221224 } )
222225
@@ -241,8 +244,8 @@ describe('Quota rendering', () => {
241244 cy . stub ( InitialState , 'loadState' )
242245 . as ( 'loadStateStats' )
243246 . returns ( {
244- used : 5 * 1000 * 1000 * 1000 ,
245- quota : 1000 * 1000 * 1000 ,
247+ used : 5 * 1024 * 1024 * 1024 ,
248+ quota : 1024 * 1024 * 1024 ,
246249 relative : 500 , // percent
247250 } )
248251
0 commit comments