Skip to content

Commit

Permalink
Migrate failing toast test
Browse files Browse the repository at this point in the history
  • Loading branch information
OEvgeny committed Dec 4, 2024
1 parent 7762b46 commit 7c43323
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 28 deletions.
5 changes: 0 additions & 5 deletions __tests__/html/toast.customizeDebounceTimeout.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@
<main id="webchat"></main>
<script>
run(async function () {
const clock = lolex.createClock();
const { directLine, store } = testHelpers.createDirectLineEmulator();

const { directLine, store } = testHelpers.createDirectLineEmulator({ ponyfill: clock });

WebChat.renderWebChat({ directLine, ponyfill: clock, store }, document.getElementById('webchat'));
WebChat.renderWebChat({ directLine, store }, document.getElementById('webchat'));

await pageConditions.webChatRendered();

clock.tick(600);

await pageConditions.uiConnected();

store.dispatch({
Expand All @@ -33,6 +29,7 @@

await pageConditions.toastShown(1);
await pageConditions.toastShown('Please read our privacy policy.');
await host.snapshot('local');

store.dispatch({
type: 'WEB_CHAT/SET_NOTIFICATION',
Expand All @@ -43,16 +40,9 @@
}
});

await pageConditions.toastShown(1);
await pageConditions.toastShown('Please read our privacy policy.');

clock.tick(400);

await pageConditions.toastShown('Please read our privacy policy.');

clock.tick(600);

await pageConditions.toastShown('Please read our privacy policy again.');
await host.snapshot('local');

store.dispatch({
type: 'WEB_CHAT/DISMISS_NOTIFICATION',
Expand All @@ -61,16 +51,8 @@
}
});

await pageConditions.toastShown(1);
await pageConditions.toastShown('Please read our privacy policy again.');

clock.tick(400);

await pageConditions.toastShown('Please read our privacy policy again.');

clock.tick(600);

await pageConditions.toastShown(0);
await host.snapshot('local');
});
</script>
</body>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7c43323

Please sign in to comment.