@@ -23,16 +23,17 @@ describe( 'ResultsPane', () => {
23
23
24
24
let wrapper ;
25
25
26
- function simulateError ( ) {
26
+ async function simulateError ( ) {
27
27
wrapper . setProps (
28
28
{
29
29
display : true ,
30
30
error : true ,
31
31
}
32
32
) ;
33
+ await wrapper . vm . $nextTick ( ) ;
33
34
}
34
35
35
- function simulateSearch ( ) {
36
+ async function simulateSearch ( ) {
36
37
wrapper . setProps (
37
38
{
38
39
display : true ,
@@ -41,32 +42,34 @@ describe( 'ResultsPane', () => {
41
42
results : RESULTS . response . docs ,
42
43
}
43
44
) ;
45
+ await wrapper . vm . $nextTick ( ) ;
44
46
}
45
47
46
48
beforeEach ( ( ) => {
47
49
wrapper = createWrapper ( ) ;
48
50
} ) ;
49
51
50
- test ( 'renders no results found correctly' , ( ) => {
52
+ test ( 'renders no results found correctly' , async ( ) => {
51
53
wrapper . setProps (
52
54
{
53
55
display : true ,
54
56
numBooks : 0 ,
55
57
results : [ ] ,
56
58
}
57
59
) ;
60
+ await wrapper . vm . $nextTick ( ) ;
58
61
59
62
expect ( wrapper . element ) . toMatchSnapshot ( ) ;
60
63
} ) ;
61
64
62
- test ( 'renders results correctly' , ( ) => {
63
- simulateSearch ( ) ;
65
+ test ( 'renders results correctly' , async ( ) => {
66
+ await simulateSearch ( ) ;
64
67
65
68
expect ( wrapper . element ) . toMatchSnapshot ( ) ;
66
69
} ) ;
67
70
68
- test ( 'renders error condition correctly' , ( ) => {
69
- simulateError ( ) ;
71
+ test ( 'renders error condition correctly' , async ( ) => {
72
+ await simulateError ( ) ;
70
73
71
74
expect ( wrapper . element ) . toMatchSnapshot ( ) ;
72
75
} ) ;
0 commit comments