(0)
const [showSecondTab, setShowSecondTab] = React.useState(false)
React.useEffect(() => {
const timer = setTimeout(() => setShowSecondTab(true), 1000)
return () => clearTimeout(timer)
}, [])
return (
Conversation
{showSecondTab && Personal notes}
Content 1
Content 2
)
},
play: async ({ canvasElement, step }) => {
const canvas = within(canvasElement.parentElement!)
expect(canvas.queryByTestId('kz-tablist-right-arrow')).not.toBeInTheDocument()
await waitFor(() => userEvent.click(canvasElement))
await new Promise((r) => setTimeout(r, 2000))
await step('Check if second tab is loaded', async () => {
await waitFor(() => {
expect(canvas.queryByText('Personal notes')).toBeInTheDocument()
})
await waitFor(async () => {
const rightTab = await canvas.findByTestId('sb-arrows-kz-tablist-right-arrow')
expect(rightTab).toBeInTheDocument()
})
})
},
}