File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ export interface PluginOptions {
29
29
baseZIndex : number
30
30
}
31
31
32
+ // ℹ️ We are exporting this so that we can use it in tests
33
+ export const defaultBaseZIndex = 2000
34
+
32
35
const configDefaults : PluginOptions = {
33
36
registerComponents : true ,
34
37
initialTheme : 'light' ,
@@ -68,7 +71,7 @@ const configDefaults: PluginOptions = {
68
71
} ,
69
72
componentAliases : { } ,
70
73
propsDefaults : { } ,
71
- baseZIndex : 2000 ,
74
+ baseZIndex : defaultBaseZIndex ,
72
75
}
73
76
74
77
export const plugin = {
Original file line number Diff line number Diff line change
1
+ import type { VueWrapper } from '@vue/test-utils'
2
+ import { mount } from '@vue/test-utils'
1
3
import { describe , expect , it } from 'vitest'
2
4
import type { ComponentPublicInstance } from 'vue'
3
5
import { defineComponent , nextTick , ref } from 'vue'
4
- import type { VueWrapper } from '@vue/test-utils '
5
- import { mount } from '@vue/test-utils '
6
- import { defaultBaseZIndex , useZIndex , zIndexContextKey } from '../../src/composables/useZIndex '
6
+ import { useZIndex } from '../../src/composables/useZIndex '
7
+ import { defaultBaseZIndex } from '../../src/plugin '
8
+ import { ANU_Z_INDEX } from '../../src/symbols '
7
9
8
10
describe ( 'useZIndex' , ( ) => {
9
11
let wrapper : VueWrapper < ComponentPublicInstance >
10
12
11
13
const mountComponent = ( provideZIndex ?: number ) => mount (
14
+ // eslint-disable-next-line vue/require-name-property
12
15
defineComponent ( {
13
16
setup ( _ , { expose } ) {
14
17
const zIndex = useZIndex ( )
@@ -19,7 +22,7 @@ describe('useZIndex', () => {
19
22
{
20
23
global : {
21
24
provide : {
22
- [ zIndexContextKey ] : ref ( provideZIndex ) ,
25
+ [ ANU_Z_INDEX as symbol ] : ref ( provideZIndex ) ,
23
26
} ,
24
27
} ,
25
28
} ,
You can’t perform that action at this time.
0 commit comments