Skip to content

Commit

Permalink
(bento): refactor test to use existing shadow root utilities (ampproj…
Browse files Browse the repository at this point in the history
  • Loading branch information
dethstrobe authored Oct 21, 2021
1 parent 1d83c38 commit c6be042
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions test/e2e/test-bento.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,11 @@ describes.endtoend(
// is attached as soon as possible.
// (Feel free to increase if flaky.)
this.timeout(100);

const shadowRoot = await env.controller.evaluate(
() =>
new Promise((resolve) => {
function getShadowRoot() {
const {shadowRoot} = document.body.firstElementChild;
if (shadowRoot) {
resolve(shadowRoot);
} else {
setTimeout(getShadowRoot, 15);
}
}
getShadowRoot();
})
await env.controller.switchToShadowRoot(
await env.controller.findElement('bento-timeago')
);
await expect(shadowRoot).ok;

await expect(await env.controller.findElement('time')).ok;
});
}
);

0 comments on commit c6be042

Please sign in to comment.