Skip to content

Commit f67cc87

Browse files
test(vue3): adapt VirtualList spec for script setup
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent ab9d02f commit f67cc87

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/tests/views/FilesList/VirtualList.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55

66
import { beforeEach, describe, expect, it, vi } from 'vitest'
77
import { mount } from '@vue/test-utils'
8-
import { markRaw } from 'vue'
8+
import { markRaw } from '@vue/reactivity'
99

1010
import VirtualList from '../../../views/FilesList/VirtualList.vue'
1111

12+
const RowComponent = markRaw({
13+
name: 'RowComponent',
14+
props: ['source', 'loading'],
15+
template: '<tr class="row-component"><td>{{ source.name }}</td></tr>',
16+
})
17+
1218
const filesStoreMock = {
1319
loading: false,
1420
getAllFiles: vi.fn(),
@@ -69,11 +75,7 @@ describe('VirtualList.vue', () => {
6975
function createWrapper() {
7076
return mount(VirtualList, {
7177
props: {
72-
dataComponent: markRaw({
73-
name: 'RowComponent',
74-
props: ['source', 'loading'],
75-
template: '<tr class="row-component"><td>{{ source.name }}</td></tr>',
76-
}),
78+
dataComponent: RowComponent,
7779
loading: false,
7880
caption: 'Files table',
7981
},

0 commit comments

Comments
 (0)