2026-07-07 10:37:00 +02:00
|
|
|
import FileInfo from '../../../../../src/components/SideBar/Files/FileInfo.vue'
|
|
|
|
|
import {
|
|
|
|
|
defaultComponentMocks,
|
|
|
|
|
defaultPlugins,
|
2026-10-02 08:13:31 +02:00
|
|
|
RouteLocation,
|
|
|
|
|
shallowMount
|
|
|
|
|
} from '../../../../../src/testing'
|
2026-07-07 10:37:00 +02:00
|
|
|
import { mock } from 'vitest-mock-extended'
|
|
|
|
|
import { Resource } from '@ownclouders/web-client'
|
|
|
|
|
|
|
|
|
|
const selectors = {
|
|
|
|
|
name: '[data-testid="files-info-name"]'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
describe('FileInfo', () => {
|
|
|
|
|
it('shows file info', () => {
|
|
|
|
|
const { wrapper } = createWrapper()
|
|
|
|
|
expect(wrapper.find(selectors.name).exists()).toBeTruthy()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function createWrapper() {
|
|
|
|
|
const file = mock<Resource>({
|
|
|
|
|
name: 'someFolder',
|
|
|
|
|
webDavPath: '',
|
|
|
|
|
type: 'folder',
|
|
|
|
|
extension: ''
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
wrapper: shallowMount(FileInfo, {
|
|
|
|
|
global: {
|
|
|
|
|
plugins: [...defaultPlugins()],
|
|
|
|
|
provide: {
|
|
|
|
|
resource: file
|
|
|
|
|
},
|
|
|
|
|
mocks: {
|
|
|
|
|
...defaultComponentMocks({ currentRoute: mock<RouteLocation>({ path: '/files' }) })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|