Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
yanick committed Feb 13, 2024
2 parents 0695343 + c4ce879 commit e13a6b1
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 27 deletions.
29 changes: 6 additions & 23 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: husky
versions:
- 5.0.9
- 5.1.0
- 5.1.1
- 5.1.2
- 5.1.3
- 5.2.0
- dependency-name: "@commitlint/config-conventional"
versions:
- 12.0.0
- 12.0.1
- dependency-name: "@commitlint/cli"
versions:
- 12.0.0
- 12.0.1
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '10:00'
open-pull-requests-limit: 10
4 changes: 2 additions & 2 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: 'Lint PR'

on:
pull_request_target:
Expand All @@ -12,6 +12,6 @@ jobs:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [main]
branches: [main, next]
pull_request:
branches: [main]
branches: [main, next]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"@testing-library/jest-dom": "^6.3.0",
"@testing-library/user-event": "^14.5.2",
"@typescript-eslint/eslint-plugin": "6.19.1",
"@typescript-eslint/parser": "6.19.1",
"@vitest/coverage-v8": "^0.33.0",
Expand Down
18 changes: 18 additions & 0 deletions src/__tests__/fixtures/Transitioner.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script>
import { blur } from 'svelte/transition'
let show = false
let introDone = false
</script>

<button on:click={() => (show = true)}>Show</button>

{#if show}
<div in:blur={{ duration: 64 }} on:introend={() => (introDone = true)}>
{#if introDone}
<p data-testid="intro-done">Done</p>
{:else}
<p data-testid="intro-pending">Pending</p>
{/if}
</div>
{/if}
30 changes: 30 additions & 0 deletions src/__tests__/transition.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { userEvent } from '@testing-library/user-event'
import { beforeEach, describe, expect, test, vi } from 'vitest'

import { render, screen, waitFor } from '..'
import Transitioner from './fixtures/Transitioner.svelte'

describe('transitions', () => {
beforeEach(() => {
if (window.navigator.userAgent.includes('jsdom')) {
const raf = (fn) => setTimeout(() => fn(new Date()), 16)
vi.stubGlobal('requestAnimationFrame', raf)
}
})

test('on:introend', async () => {
const user = userEvent.setup()

render(Transitioner)
const start = screen.getByRole('button')
await user.click(start)

const pending = screen.getByTestId('intro-pending')
expect(pending).toBeInTheDocument()

await waitFor(() => {
const done = screen.queryByTestId('intro-done')
expect(done).toBeInTheDocument()
})
})
})

0 comments on commit e13a6b1

Please sign in to comment.