Skip to content

Commit

Permalink
delete wait_for_animation_end() and fix tests to use playwright auto-…
Browse files Browse the repository at this point in the history
…waiting correctly
  • Loading branch information
janosh committed Apr 11, 2023
1 parent 2b2eb0d commit 2493029
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 32 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ on:
jobs:
tests:
uses: janosh/workflows/.github/workflows/npm-test-release.yml@main
secrets: inherit
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@
"update-coverage": "vitest tests/unit --run --coverage && npx istanbul-badges-readme"
},
"dependencies": {
"svelte": "^3.57.0"
"svelte": "^3.58.0"
},
"devDependencies": {
"@iconify/svelte": "^3.1.0",
"@playwright/test": "^1.31.2",
"@iconify/svelte": "^3.1.1",
"@playwright/test": "^1.32.2",
"@sveltejs/adapter-static": "^2.0.1",
"@sveltejs/kit": "^1.12.0",
"@sveltejs/kit": "^1.15.2",
"@sveltejs/package": "2.0.2",
"@sveltejs/vite-plugin-svelte": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@vitest/coverage-c8": "^0.29.3",
"eslint": "^8.36.0",
"@sveltejs/vite-plugin-svelte": "^2.0.4",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitest/coverage-c8": "^0.30.0",
"eslint": "^8.38.0",
"eslint-plugin-svelte3": "^4.0.0",
"hastscript": "^7.2.0",
"highlight.js": "^11.7.0",
"jsdom": "^21.1.1",
"mdsvex": "^0.10.6",
"mdsvexamples": "^0.3.3",
"prettier": "^2.8.4",
"prettier-plugin-svelte": "^2.9.0",
"prettier": "^2.8.7",
"prettier-plugin-svelte": "^2.10.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.1.0",
"svelte-check": "^3.1.4",
"svelte-check": "^3.2.0",
"svelte-preprocess": "^5.0.3",
"svelte-toc": "^0.5.4",
"svelte-zoo": "^0.4.3",
"svelte2tsx": "^0.6.10",
"typescript": "5.0.2",
"vite": "^4.2.0",
"vitest": "^0.29.3"
"svelte2tsx": "^0.6.11",
"typescript": "5.0.4",
"vite": "^4.2.1",
"vitest": "^0.30.0"
},
"keywords": [
"svelte",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/CmdPalette.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// for span in option slot, has no effect when passing slot="option"
export let span_style: string = ``
export let open: boolean = false
export let dialog: HTMLDialogElement
export let input: HTMLInputElement
export let dialog: HTMLDialogElement | null = null
export let input: HTMLInputElement | null = null
export let placeholder: string = `Filter actions...`
type Action = { label: string; action: () => void }
Expand Down
5 changes: 1 addition & 4 deletions tests/MultiSelect.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect, test } from '@playwright/test'
import { foods } from '../src/site/options.ts'
import { wait_for_animation_end } from './index.ts'

// to run tests in this file, use `npm run test:e2e`

Expand Down Expand Up @@ -466,9 +465,8 @@ test.describe(`maxSelect`, async () => {
page,
}) => {
const ul_selector = `#languages ul.options`
await wait_for_animation_end(page, ul_selector)

expect(await page.locator(ul_selector)).toBeHidden()
await expect(page.locator(ul_selector)).toBeHidden()
expect(await page.getAttribute(ul_selector, `class`)).toContain(`hidden`)
})

Expand Down Expand Up @@ -504,7 +502,6 @@ test.describe(`slots`, async () => {

// then click on the expand icon to open the dropdown and change open to true
await page.click(`#languages-1 input + svg`)
await wait_for_animation_end(page, `#languages-1 ul.options`)

// assert that the collapse icon path differs from expand icon path
const collapse_icon_path = await page.$eval(
Expand Down
9 changes: 0 additions & 9 deletions tests/index.ts

This file was deleted.

0 comments on commit 2493029

Please sign in to comment.