Skip to content

Commit

Permalink
test: fix Safari errors in CI (#440)
Browse files Browse the repository at this point in the history
* test: fix DOM assertion in a test for Safari 9

* test: fix pushState throttler for iOS 12
  • Loading branch information
platosha authored Feb 26, 2020
1 parent c68243b commit cee8143
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions test/router/parent-layouts.spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@
it('should throw not found when neither children nor siblings match', async() => {
// Ensure outlet is clean
const childNodes = Array.from(outlet.childNodes);
outlet.textContent = '';
while (outlet.childNodes.length) {
outlet.removeChild(outlet.lastChild);
}

router.setRoutes([
{path: '/a', component: 'x-a', children: [
Expand All @@ -269,7 +271,9 @@
expect(error.message).to.match(/page not found/i);

// Restore previous outlet content
outlet.textContent = '';
while (outlet.childNodes.length) {
outlet.removeChild(outlet.lastChild);
}
childNodes.forEach(childNode => outlet.appendChild(childNode));
});

Expand Down
2 changes: 1 addition & 1 deletion test/test-pushstate-throttler.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@
return new Promise((resolve, reject) => {
if (runnerWindow.pushStateCount > 85 || force) {
const cooldownPeriod = 30 * 1000;
test.timeout(cooldownPeriod + 5000);
const cooldownMessage = this.$['safari-cooldown'];
cooldownMessage.removeAttribute('hidden');
setTimeout(() => {
cooldownMessage.setAttribute('hidden', 'hidden');
runnerWindow.pushStateCount = 0;
resolve();
}, cooldownPeriod);
test.timeout(cooldownPeriod + 5000);
} else {
resolve();
}
Expand Down

0 comments on commit cee8143

Please sign in to comment.