Skip to content

Commit

Permalink
fix(web-components): add 100ms delay to deflake test
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Jan 10, 2022
1 parent 2ee65b6 commit c5b8bb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/web-components/test/agoric-wallet-connection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import '../demo/install-ses-lockdown.js';
import { E } from '@agoric/eventual-send';
import { html } from 'lit';
import { fixture, expect, nextFrame } from '@open-wc/testing';
import { fixture, expect } from '@open-wc/testing';

import { Server } from 'mock-socket/dist/mock-socket.es';
import { makeAgoricWalletConnection } from '../src/AgoricWalletConnection.js';
Expand Down Expand Up @@ -163,8 +163,7 @@ describe('AgoricWalletConnection', () => {
iframeOnMessage('http://localhost:8000');

await createStatePromise('bridged');
await nextFrame();
await nextFrame();
await new Promise(resolve => setTimeout(resolve, 100));

expect(el.state).to.equal('bridged');
});
Expand All @@ -179,9 +178,10 @@ describe('AgoricWalletConnection', () => {

it('lets capTP send messages through the websocket', async () => {
iframeOnMessage('http://localhost:8000');
await new Promise(resolve => setTimeout(resolve, 100));

captpInnards.send({ foo: 'bar2' });
await nextFrame();
await new Promise(resolve => setTimeout(resolve, 100));

expect(lastMessage).to.equal(JSON.stringify({ foo: 'bar2' }));
});
Expand Down

0 comments on commit c5b8bb4

Please sign in to comment.