File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
packages/hooks/src/useUpdate Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { mount } from '@vue/test-utils'
2
+ import { ref } from 'vue'
3
+
4
+ import Demo from '../demo/demo.vue'
5
+
6
+ describe ( 'useUpdate' , ( ) => {
7
+ const wrapper = mount ( Demo )
8
+
9
+ const showText = wrapper . find ( '.text' )
10
+ const btn = wrapper . find ( '.btn' )
11
+
12
+ const prevRef = ref ( showText . text ( ) )
13
+
14
+ it ( 'should work' , async ( ) => {
15
+ await btn . trigger ( 'click' )
16
+ expect ( showText . text ( ) === prevRef . value ) . toBeFalsy ( )
17
+ } )
18
+ } )
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <div >Time: {{ date }}</div >
4
- <vhp-button type =" vhp-button" @click =" () => setUpdate()" >update</vhp-button >
3
+ <div class = " text " >Time: {{ date }}</div >
4
+ <vhp-button class = " btn " type =" vhp-button" @click =" () => setUpdate()" >update</vhp-button >
5
5
</div >
6
6
</template >
7
7
You can’t perform that action at this time.
0 commit comments