Skip to content

Commit df40640

Browse files
committed
ResultsPane.test.js: stop using sync mode [+]
https://jira.nyu.edu/jira/browse/NYUP-804 vuejs/vue-test-utils#1137
1 parent a16a195 commit df40640

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/unit/components/ResultsPane.test.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ describe( 'ResultsPane', () => {
2323

2424
let wrapper;
2525

26-
function simulateError() {
26+
async function simulateError() {
2727
wrapper.setProps(
2828
{
2929
display : true,
3030
error : true,
3131
}
3232
);
33+
await wrapper.vm.$nextTick();
3334
}
3435

35-
function simulateSearch() {
36+
async function simulateSearch() {
3637
wrapper.setProps(
3738
{
3839
display : true,
@@ -41,32 +42,34 @@ describe( 'ResultsPane', () => {
4142
results : RESULTS.response.docs,
4243
}
4344
);
45+
await wrapper.vm.$nextTick();
4446
}
4547

4648
beforeEach( () => {
4749
wrapper = createWrapper();
4850
} );
4951

50-
test( 'renders no results found correctly', () => {
52+
test( 'renders no results found correctly', async () => {
5153
wrapper.setProps(
5254
{
5355
display : true,
5456
numBooks : 0,
5557
results : [],
5658
}
5759
);
60+
await wrapper.vm.$nextTick();
5861

5962
expect( wrapper.element ).toMatchSnapshot();
6063
} );
6164

62-
test( 'renders results correctly', () => {
63-
simulateSearch();
65+
test( 'renders results correctly', async () => {
66+
await simulateSearch();
6467

6568
expect( wrapper.element ).toMatchSnapshot();
6669
} );
6770

68-
test( 'renders error condition correctly', () => {
69-
simulateError();
71+
test( 'renders error condition correctly', async () => {
72+
await simulateError();
7073

7174
expect( wrapper.element ).toMatchSnapshot();
7275
} );

0 commit comments

Comments
 (0)