0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/playwright/e2e-vrt/lemon-ui/LemonButton.spec.ts
Michael Matloka 59d4398646
ci(vrt): Stop the snapshot madness (#17163)
* Remove redundant Playwright specs

* Increase tolerance in Playwright

* Wait for profile pictures to resolve

* Ensure scene is loaded before proceeding

* Always wait for loaders to disappear

* Disable Gravatars in snapshots

* Don't wait for loaders in more stories with loaders

* Improve resiliency of batch export story

* Fix one more loading story

* Unskip Playwright tests

* Improve inconsistencies

* Upgrade Playwright from 1.29.2 to 1.37.1

* Wait for images to load

* Unify code editors

* Properly wait for images to load

* Go back to Playwright 1.29.2

* Wait for loader selector in LemonTable stories

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-29 09:28:03 +02:00

18 lines
813 B
TypeScript

import { toId } from '../../helpers/storybook'
import { test } from '../../fixtures/storybook'
test.describe('Lemon Button', () => {
// TODO: Remove when our Storybook test runner supports play tests
test('displays hover state correctly', async ({ storyPage }) => {
await storyPage.goto(toId('Lemon UI/Lemon Button', 'Default'))
await storyPage.expectComponentScreenshot({ pseudo: { hover: true } })
})
test('displays disabled reason correctly', async ({ storyPage }) => {
await storyPage.goto(toId('Lemon UI/Lemon Button', 'Disabled With Reason'))
await storyPage.storyRoot.locator('.LemonButton').nth(2).hover()
await storyPage.page.getByRole('tooltip').waitFor()
await storyPage.expectComponentScreenshot({ pseudo: { hover: true } })
})
})