Skip to content

Commit b2a7934

Browse files
committed
Add flag to ensure interaction test doesn't fail on ophan function call
1 parent 2e59107 commit b2a7934

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dotcom-rendering/src/components/LoopVideo.stories.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ export const PausePlay: Story = {
6464

6565
export const UnmuteMute: Story = {
6666
...Default,
67+
parameters: {
68+
test: {
69+
// The following error is received without this flag: "TypeError: ophan.trackClickComponentEvent is not a function"
70+
dangerouslyIgnoreUnhandledErrors: true,
71+
},
72+
},
6773
play: async ({ canvasElement }) => {
6874
const canvas = within(canvasElement);
6975

@@ -94,13 +100,13 @@ export const InteractionObserver: Story = {
94100
play: async ({ canvasElement }) => {
95101
const canvas = within(canvasElement);
96102

97-
await sleep(300);
103+
await sleep(300); // Allow enough time for the autoplay video to start.
98104
canvas.getByTestId('page-end').scrollIntoView();
99105

100106
const progressBar = await canvas.findByRole('progressbar');
101107
const progress = Number(progressBar.ariaValueNow);
102108

103-
await sleep(300);
109+
await sleep(200); // Allow enough time to be confident that the video is paused.
104110
await expect(Number(progressBar.ariaValueNow)).toEqual(progress);
105111
await expect(canvas.queryByTestId('play-icon')).not.toBeInTheDocument();
106112
},

0 commit comments

Comments
 (0)