Skip to content

Commit

Permalink
test: handle failed case
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Feb 27, 2024
1 parent 9cad502 commit 245b55a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions playground/e2e/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test.describe('Base tests', () => {
await openDrawer(page)
await page.hover('[vaul-drawer]')
await page.mouse.down()
await page.mouse.move(0, 800)
await page.mouse.move(0, 500)
await page.mouse.up()
await page.waitForTimeout(ANIMATION_DURATION)
await expect(page.getByTestId('content')).not.toBeVisible()
Expand All @@ -54,7 +54,7 @@ test.describe('Base tests', () => {
await openDrawer(page)
await page.hover('[vaul-drawer]')
await page.mouse.down()
await page.mouse.move(0, -800)
await page.mouse.move(0, -500)
await page.mouse.up()
await page.waitForTimeout(ANIMATION_DURATION)
await expect(page.getByTestId('content')).toBeVisible()
Expand Down
15 changes: 9 additions & 6 deletions playground/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ export default defineConfig({
...devices['Desktop Firefox'],
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
},

/** Ignore testing safari for now */
// {
// name: 'webkit',
// use: {
// ...devices['Desktop Safari'],
// viewport: { width: 1600, height: 1200 },
// },
// },

/* Test against mobile viewports. */
// {
Expand Down
15 changes: 8 additions & 7 deletions playground/src/views/tests/WithoutScaledBackgroundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@ const open = ref < boolean > (false)
<DrawerOverlay data-testid="overlay" class="fixed inset-0 bg-black/40" />
<DrawerContent
data-testid="content"
class="bg-zinc-100 flex flex-col rounded-t-[10px] h-[96%] mt-24 fixed bottom-0 left-0 right-0"
class="bg-zinc-100 flex flex-col rounded-t-[10px] h-[90%] mt-24 fixed bottom-0 left-0 right-0"
>
<DrawerClose data-testid="drawer-close">
Close
</DrawerClose>
<button data-testid="controlled-close" class="text-2xl" @click="open = false">
Close
</button>
<div class="p-4 bg-white rounded-t-[10px] flex-1">
<div class="mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-zinc-300 mb-8" />
<div class="max-w-md mx-auto">
Expand All @@ -47,6 +41,13 @@ const open = ref < boolean > (false)
This component can be used as a replacement for a Dialog on mobile and tablet devices.
</p>
</div>
<!-- Move close button to bottom -->
<DrawerClose data-testid="drawer-close">
Close
</DrawerClose>
<button data-testid="controlled-close" class="text-2xl" @click="open = false">
Close
</button>
</DrawerContent>
</DrawerPortal>
</DrawerRoot>
Expand Down
Empty file removed playwright.config.ts
Empty file.

0 comments on commit 245b55a

Please sign in to comment.