Skip to content

Commit

Permalink
Maybe add a wait
Browse files Browse the repository at this point in the history
  • Loading branch information
pksjce committed Aug 16, 2022
1 parent ba26154 commit 67c5a22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PageLayout/interaction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ const isInViewPort = (boundingRect: {top: number; left: number; right: number; b
StickyPane.play = async ({canvasElement}: {canvasElement: HTMLElement}) => {
const canvas = within(canvasElement)
const content3 = await canvas.getByTestId('content3')
// Trying to see if waiting for a bit makes the test more obvious
await new Promise(r => setTimeout(r, 1000))
content3.scrollIntoView()
const paragraph0 = await canvas.getByTestId('paragraph0')
const paragraphRect = paragraph0.getBoundingClientRect()
Expand Down Expand Up @@ -387,6 +389,7 @@ NonStickyPane.argTypes = {
NonStickyPane.play = async ({canvasElement}: {canvasElement: HTMLElement}) => {
const canvas = within(canvasElement)
const content3 = await canvas.getByTestId('content3')
await new Promise(r => setTimeout(r, 1000))
content3.scrollIntoView()
const paragraph0 = await canvas.getByTestId('paragraph0')
const paragraphRect = paragraph0.getBoundingClientRect()
Expand Down

0 comments on commit 67c5a22

Please sign in to comment.