Skip to content

Commit

Permalink
test(e2e): add new snapshots for label testing
Browse files Browse the repository at this point in the history
For Svelte 4
  • Loading branch information
theetrain committed Jul 20, 2024
1 parent 8999346 commit 893470b
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions e2e/svelte-4/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/svelte-4/src/lib/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export let disabled = false
/** @type {{ [key: string]: string }} */
export let definitions = {}
export let definitions
</script>

<button {...$$restProps} {disabled} class="{variant} {size}">
Expand Down
21 changes: 15 additions & 6 deletions e2e/svelte-4/tests/tests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@ import { test, expect } from '@playwright/test'

test('default slot', async ({ page }) => {
await page.goto('localhost:4173/')

// Expect a title "to contain" a substring.
await expect(page).toHaveScreenshot()
})

test('named slots asChild', async ({ page }) => {
await page.goto('localhost:4173/named-slots')

// Expect a title "to contain" a substring.
await expect(page).toHaveScreenshot()
})

test('custom styles', async ({ page }) => {
await page.goto('localhost:4173/custom-styles')

// Expect a title "to contain" a substring.
await expect(page).toHaveScreenshot()
})

test('short and long labels', async ({ page }) => {
await page.goto('localhost:4173/labels')
await expect(page).toHaveScreenshot({ fullPage: true })
})

test('short and long labels - dark mode', async ({ page }) => {
await page.goto('localhost:4173/labels/dark')
await expect(page).toHaveScreenshot({ fullPage: true })
})

test('slotted labels', async ({ page }) => {
await page.goto('localhost:4173/labels/custom')
await expect(page).toHaveScreenshot({ fullPage: true })
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 893470b

Please sign in to comment.