Skip to content

Commit

Permalink
ResultsPane.test.js: stop using sync mode [+]
Browse files Browse the repository at this point in the history
  • Loading branch information
da70 committed Jun 11, 2021
1 parent a16a195 commit df40640
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/unit/components/ResultsPane.test.js
Expand Up @@ -23,16 +23,17 @@ describe( 'ResultsPane', () => {

let wrapper;

function simulateError() {
async function simulateError() {
wrapper.setProps(
{
display : true,
error : true,
}
);
await wrapper.vm.$nextTick();
}

function simulateSearch() {
async function simulateSearch() {
wrapper.setProps(
{
display : true,
Expand All @@ -41,32 +42,34 @@ describe( 'ResultsPane', () => {
results : RESULTS.response.docs,
}
);
await wrapper.vm.$nextTick();
}

beforeEach( () => {
wrapper = createWrapper();
} );

test( 'renders no results found correctly', () => {
test( 'renders no results found correctly', async () => {
wrapper.setProps(
{
display : true,
numBooks : 0,
results : [],
}
);
await wrapper.vm.$nextTick();

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

test( 'renders results correctly', () => {
simulateSearch();
test( 'renders results correctly', async () => {
await simulateSearch();

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

test( 'renders error condition correctly', () => {
simulateError();
test( 'renders error condition correctly', async () => {
await simulateError();

expect( wrapper.element ).toMatchSnapshot();
} );
Expand Down

0 comments on commit df40640

Please sign in to comment.