Skip to content

Commit e13a6b1

Browse files
committed
Merge branch 'main' into next
2 parents 0695343 + c4ce879 commit e13a6b1

File tree

6 files changed

+59
-27
lines changed

6 files changed

+59
-27
lines changed

.github/dependabot.yml

+6-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "10:00"
8-
open-pull-requests-limit: 10
9-
ignore:
10-
- dependency-name: husky
11-
versions:
12-
- 5.0.9
13-
- 5.1.0
14-
- 5.1.1
15-
- 5.1.2
16-
- 5.1.3
17-
- 5.2.0
18-
- dependency-name: "@commitlint/config-conventional"
19-
versions:
20-
- 12.0.0
21-
- 12.0.1
22-
- dependency-name: "@commitlint/cli"
23-
versions:
24-
- 12.0.0
25-
- 12.0.1
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
time: '10:00'
8+
open-pull-requests-limit: 10

.github/workflows/lint-pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Lint PR"
1+
name: 'Lint PR'
22

33
on:
44
pull_request_target:
@@ -12,6 +12,6 @@ jobs:
1212
name: Validate PR title
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: amannn/action-semantic-pull-request@v4
15+
- uses: amannn/action-semantic-pull-request@v5
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, next]
66
pull_request:
7-
branches: [main]
7+
branches: [main, next]
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"devDependencies": {
7373
"@sveltejs/vite-plugin-svelte": "^2.4.2",
7474
"@testing-library/jest-dom": "^6.3.0",
75+
"@testing-library/user-event": "^14.5.2",
7576
"@typescript-eslint/eslint-plugin": "6.19.1",
7677
"@typescript-eslint/parser": "6.19.1",
7778
"@vitest/coverage-v8": "^0.33.0",
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
import { blur } from 'svelte/transition'
3+
4+
let show = false
5+
let introDone = false
6+
</script>
7+
8+
<button on:click={() => (show = true)}>Show</button>
9+
10+
{#if show}
11+
<div in:blur={{ duration: 64 }} on:introend={() => (introDone = true)}>
12+
{#if introDone}
13+
<p data-testid="intro-done">Done</p>
14+
{:else}
15+
<p data-testid="intro-pending">Pending</p>
16+
{/if}
17+
</div>
18+
{/if}

src/__tests__/transition.test.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { userEvent } from '@testing-library/user-event'
2+
import { beforeEach, describe, expect, test, vi } from 'vitest'
3+
4+
import { render, screen, waitFor } from '..'
5+
import Transitioner from './fixtures/Transitioner.svelte'
6+
7+
describe('transitions', () => {
8+
beforeEach(() => {
9+
if (window.navigator.userAgent.includes('jsdom')) {
10+
const raf = (fn) => setTimeout(() => fn(new Date()), 16)
11+
vi.stubGlobal('requestAnimationFrame', raf)
12+
}
13+
})
14+
15+
test('on:introend', async () => {
16+
const user = userEvent.setup()
17+
18+
render(Transitioner)
19+
const start = screen.getByRole('button')
20+
await user.click(start)
21+
22+
const pending = screen.getByTestId('intro-pending')
23+
expect(pending).toBeInTheDocument()
24+
25+
await waitFor(() => {
26+
const done = screen.queryByTestId('intro-done')
27+
expect(done).toBeInTheDocument()
28+
})
29+
})
30+
})

0 commit comments

Comments
 (0)