Skip to content

Commit

Permalink
test(prerender): wait for load event (#3455)
Browse files Browse the repository at this point in the history
this commit fixes an issue where stencil's prerender tests that would begin to run before
the entire pre-render application would be loaded. this is accomplished by moving from
using the 'appload' event to the 'load' event to listen on by moving from the timeout
associated with `setupDom` to the `waitForChanges` API our testing utilities provides

STENCIL-433: Stabilize Browserstack CI Tests
  • Loading branch information
rwaskiewicz authored Jul 6, 2022
1 parent 658fdd8 commit c0aeac1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/karma/test-app/prerender-test/karma.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setupDomTests } from '../util';
import { setupDomTests, waitForChanges } from '../util';

describe('prerender', () => {
const { setupDom, tearDownDom } = setupDomTests(document);
Expand Down Expand Up @@ -42,7 +42,8 @@ describe('prerender', () => {
});

it('root slots', async () => {
app = await setupDom('/prerender/index.html', 1000);
app = await setupDom('/prerender/index.html');
await waitForChanges(500);

const scoped = app.querySelector('cmp-client-scoped');
const scopedStyle = getComputedStyle(scoped.querySelector('section'));
Expand Down

0 comments on commit c0aeac1

Please sign in to comment.