Skip to content

Commit

Permalink
fix: fix intermittent test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ppiyush13 committed Nov 14, 2022
1 parent 729498a commit a6c021d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion e2e/grid-scroll-seek-placeholder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('list with scroll seek placeholders', () => {
}, 10)
})

await page.waitForTimeout(200)
await page.waitForSelector('#test-root div[aria-label=placeholder]')

const [width, height, containerPaddingTop, text, color] = await page.evaluate(() => {
const container = document.querySelector('#test-root > div > div:first-child > div') as HTMLElement
Expand Down
2 changes: 1 addition & 1 deletion e2e/scroll-seek-placeholder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('list with scroll seek placeholders', () => {
}, 10)
})

await page.waitForTimeout(200)
await page.waitForSelector('#test-root div[aria-label=placeholder]')

const color = await page.evaluate(() => {
const stickyItem = document.querySelector('#test-root > div > div:first-child > div > div') as HTMLElement
Expand Down
6 changes: 5 additions & 1 deletion examples/grid-scroll-seek-placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export default function App() {
components={{
Item: ItemContainer,
List: ListContainer,
ScrollSeekPlaceholder: ({ index, width, height }) => <div style={{ height, width, color: 'red' }}>Placeholder {index}</div>,
ScrollSeekPlaceholder: ({ index, width, height }) => (
<div aria-label="placeholder" style={{ height, width, color: 'red' }}>
Placeholder {index}
</div>
),
}}
/>
)
Expand Down
6 changes: 5 additions & 1 deletion examples/scroll-seek-placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export default function App() {
exit: (velocity) => Math.abs(velocity) < 30,
}}
components={{
ScrollSeekPlaceholder: ({ height, index }) => <div style={{ height, color: 'red' }}>Placeholder {index}</div>,
ScrollSeekPlaceholder: ({ height, index }) => (
<div aria-label="placeholder" style={{ height, color: 'red' }}>
Placeholder {index}
</div>
),
}}
/>
)
Expand Down

0 comments on commit a6c021d

Please sign in to comment.