Skip to content

Commit

Permalink
fix: update navbar Jest test to wait until page navigation has finish…
Browse files Browse the repository at this point in the history
…ed. fixes inconsistent navbar test
  • Loading branch information
sghoweri committed May 24, 2019
1 parent b31636c commit 1caad66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/bolt-navbar/__tests__/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ describe('<bolt-navbar> Component', () => {
document.body.appendChild(div);
}, html);

const navigationPromise = page.waitForNavigation();
await page.hover('.c-bolt-navbar__title--link');

const image = await page.screenshot();
expect(image).toMatchImageSnapshot(imageVrtConfig);

await page.tap('.c-bolt-navbar__title--link');
await page.click('.c-bolt-navbar__title--link');
await navigationPromise; // wait for page navigation to finish before verifying the navbar link rendered + brought us to the main docs site

const pageTitle = await page.title();
expect(pageTitle).toMatch('Bolt Design System');
Expand Down

0 comments on commit 1caad66

Please sign in to comment.