Skip to content

Commit

Permalink
test: puppeteer's waitFor is deprecated, replace with waitForTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschmidt committed Oct 8, 2020
1 parent 4266eae commit 29cf5c0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/button/button.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('limel-button', () => {
});
describe('after 2 seconds', () => {
beforeEach(async () => {
await page.waitFor(1900);
await page.waitForTimeout(1900);
await page.waitForChanges();
});
it('the visual state becomes "not loading" after 2 seconds', () => {
Expand Down Expand Up @@ -276,7 +276,7 @@ describe('limel-button', () => {

describe('after 2 seconds', () => {
beforeEach(async () => {
await page.waitFor(1900);
await page.waitForTimeout(1900);
await page.waitForChanges();
});
it('the visual state becomes "not loading" after 2 seconds', () => {
Expand All @@ -287,7 +287,7 @@ describe('limel-button', () => {

describe('and then setting the property to `true`', () => {
beforeEach(async () => {
page.waitFor(100);
page.waitForTimeout(100);
limelButton.setProperty('loading', true);
await page.waitForChanges();
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/list/list.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe('limel-list', () => {
beforeEach(async () => {
item = await innerList.find('li');
await item.click();
await page.waitFor(20); // Give the event a chance to bubble.
await page.waitForTimeout(20); // Give the event a chance to bubble.
});
it('is emitted', () => {
expect(spy).toHaveReceivedEventTimes(1);
Expand Down Expand Up @@ -249,7 +249,7 @@ describe('limel-list', () => {
beforeEach(async () => {
item = await innerList.find('li');
await item.click();
await page.waitFor(20); // Give the event a chance to bubble.
await page.waitForTimeout(20); // Give the event a chance to bubble.
});
it('is emitted', () => {
expect(spy).toHaveReceivedEventTimes(1);
Expand Down
6 changes: 3 additions & 3 deletions src/components/snackbar/snackbar.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('limel-snackbar', () => {

it('displays the message', async () => {
// Some extra waiting is required for the content to be populated.
await page.waitFor(1000);
await page.waitForTimeout(1000);
snackbarLabel = await mdcSnackbar.find('.mdc-snackbar__label');
expect(snackbarLabel).toEqualText('This is a message');
});
Expand All @@ -47,7 +47,7 @@ describe('limel-snackbar', () => {
spy = await snackbar.spyOnEvent('hide');
await snackbar.callMethod('show');
await page.waitForChanges();
await page.waitFor(4000);
await page.waitForTimeout(4000);
await page.waitForChanges();
});

Expand Down Expand Up @@ -78,7 +78,7 @@ describe('limel-snackbar', () => {

it('displays the message', async () => {
// Some extra waiting is required for the content to be populated.
await page.waitFor(1000);
await page.waitForTimeout(1000);
snackbarLabel = await mdcSnackbar.find('.mdc-snackbar__label');
expect(snackbarLabel).toEqualText('This is a message');
});
Expand Down

0 comments on commit 29cf5c0

Please sign in to comment.