@@ -7,61 +7,61 @@ describe('useAlignment blackbox test', () => {
7
7
// To try to ensure it is ComputedRef
8
8
it ( 'value to contain property value' , ( ) => {
9
9
const prop : { value : Alignment . JustifyContent } = { value : 'center' }
10
- const value = useAlignment ( toRef ( prop , 'value' ) )
11
- expect ( value ) . toHaveProperty ( 'value' )
10
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
11
+ expect ( computedRef ) . toHaveProperty ( 'value' )
12
12
} )
13
13
14
14
it ( 'value to contain property effect' , ( ) => {
15
15
const prop : { value : Alignment . JustifyContent } = { value : 'center' }
16
- const value = useAlignment ( toRef ( prop , 'value' ) )
17
- expect ( value ) . toHaveProperty ( 'effect' )
16
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
17
+ expect ( computedRef ) . toHaveProperty ( 'effect' )
18
18
} )
19
19
20
20
it ( 'value of center returns justify-content-center' , ( ) => {
21
21
const prop : { value : Alignment . JustifyContent } = { value : 'center' }
22
- const value = useAlignment ( toRef ( prop , 'value' ) )
23
- expect ( value ) . toBe ( 'justify-content-center' )
22
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
23
+ expect ( computedRef . value ) . toBe ( 'justify-content-center' )
24
24
} )
25
25
26
26
it ( 'value of end returns justify-content-end' , ( ) => {
27
27
const prop : { value : Alignment . JustifyContent } = { value : 'end' }
28
- const value = useAlignment ( toRef ( prop , 'value' ) )
29
- expect ( value ) . toBe ( 'justify-content-end' )
28
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
29
+ expect ( computedRef . value ) . toBe ( 'justify-content-end' )
30
30
} )
31
31
32
32
it ( 'value of start returns justify-content-start' , ( ) => {
33
33
const prop : { value : Alignment . JustifyContent } = { value : 'start' }
34
- const value = useAlignment ( toRef ( prop , 'value' ) )
35
- expect ( value ) . toBe ( 'justify-content-start' )
34
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
35
+ expect ( computedRef . value ) . toBe ( 'justify-content-start' )
36
36
} )
37
37
38
38
it ( 'value of fill returns justify-content-start' , ( ) => {
39
39
const prop : { value : Alignment . JustifyContent } = { value : 'around' }
40
- const value = useAlignment ( toRef ( prop , 'value' ) )
41
- expect ( value ) . toBe ( 'justify-content-around' )
40
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
41
+ expect ( computedRef . value ) . toBe ( 'justify-content-around' )
42
42
} )
43
43
44
44
it ( 'value of fill returns justify-content-start' , ( ) => {
45
45
const prop : { value : Alignment . JustifyContent } = { value : 'evenly' }
46
- const value = useAlignment ( toRef ( prop , 'value' ) )
47
- expect ( value ) . toBe ( 'justify-content-evenly' )
46
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
47
+ expect ( computedRef . value ) . toBe ( 'justify-content-evenly' )
48
48
} )
49
49
50
50
it ( 'return value to be reactive' , ( ) => {
51
51
const prop : { value : Alignment . JustifyContent } = reactive ( { value : 'center' } )
52
- const value = useAlignment ( toRef ( prop , 'value' ) )
53
- expect ( value . value ) . toBe ( 'justify-content-center' )
52
+ const computedRef = useAlignment ( toRef ( prop , 'value' ) )
53
+ expect ( computedRef . value ) . toBe ( 'justify-content-center' )
54
54
prop . value = 'end'
55
- expect ( value . value ) . toBe ( 'justify-content-end' )
55
+ expect ( computedRef . value ) . toBe ( 'justify-content-end' )
56
56
prop . value = 'around'
57
- expect ( value . value ) . toBe ( 'justify-content-around' )
57
+ expect ( computedRef . value ) . toBe ( 'justify-content-around' )
58
58
prop . value = 'between'
59
- expect ( value . value ) . toBe ( 'justify-content-between' )
59
+ expect ( computedRef . value ) . toBe ( 'justify-content-between' )
60
60
prop . value = 'evenly'
61
- expect ( value . value ) . toBe ( 'justify-content-evenly' )
61
+ expect ( computedRef . value ) . toBe ( 'justify-content-evenly' )
62
62
prop . value = 'end'
63
- expect ( value . value ) . toBe ( 'justify-content-end' )
63
+ expect ( computedRef . value ) . toBe ( 'justify-content-end' )
64
64
prop . value = 'start'
65
- expect ( value . value ) . toBe ( 'justify-content-start' )
65
+ expect ( computedRef . value ) . toBe ( 'justify-content-start' )
66
66
} )
67
67
} )
0 commit comments