Skip to content

Commit 7ac0fb7

Browse files
author
Corentin Marzin
committed
add test from sonner
1 parent a30f60f commit 7ac0fb7

File tree

10 files changed

+2000
-3444
lines changed

10 files changed

+2000
-3444
lines changed

components.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export {}
77
/* prettier-ignore */
88
declare module 'vue' {
99
export interface GlobalComponents {
10-
'Carbon:cafe': typeof import('~icons/carbon/cafe')['default']
11-
'Carbon:logoTwitter': typeof import('~icons/carbon/logo-twitter')['default']
1210
CheckIcon: typeof import('./src/components/icons/CheckIcon.vue')['default']
1311
CopyIcon: typeof import('./src/components/icons/CopyIcon.vue')['default']
1412
Expand: typeof import('./src/components/Expand.vue')['default']
@@ -17,7 +15,6 @@ declare module 'vue' {
1715
HeadlessToastWithProps: typeof import('./src/components/HeadlessToastWithProps.vue')['default']
1816
Hero: typeof import('./src/components/Hero.vue')['default']
1917
Installation: typeof import('./src/components/Installation.vue')['default']
20-
'Mdi:heart': typeof import('~icons/mdi/heart')['default']
2118
Others: typeof import('./src/components/Others.vue')['default']
2219
Position: typeof import('./src/components/Position.vue')['default']
2320
Styling: typeof import('./src/components/Styling.vue')['default']

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"author": "xiaoluoboding <xiaoluoboding@gmail.com>",
66
"scripts": {
77
"dev": "vite",
8+
"build:dev": "vite build --mode lib --watch",
89
"build:docs": "vite build --mode docs",
910
"build:lib": "vite build --mode lib && pnpm run build:types",
1011
"build:types": "vue-tsc -p tsconfig.build.json && api-extractor run",

packages/state.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class Observer {
8585
)
8686
})
8787
}
88+
console.log('coucou 3')
8889

8990
this.subscribers.forEach((subscriber) => subscriber({ id, dismiss: true }))
9091
return id

test/e2e/vue.spec.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ test.describe('Basic functionality', () => {
4040
await expect(toast.promise(rejectedPromise, {}).unwrap()).rejects.toThrow('Promise rejected');
4141
});
4242

43-
test('render custom jsx in toast', async ({ page }) => {
44-
await page.getByTestId('custom').click();
45-
await expect(page.getByText('jsx')).toHaveCount(1);
46-
});
47-
4843
test('toast is removed after swiping down', async ({ page }) => {
4944
await page.getByTestId('default-button').click();
5045
await page.hover('[data-sonner-toast]');
@@ -102,7 +97,7 @@ test.describe('Basic functionality', () => {
10297
});
10398

10499
test('toast is dismissed programmatically after 500ms', async ({ page }) => {
105-
await page.getByTestId('infinity-toast').click();
100+
await page.getByTestId('dismiss-toast').click();
106101
const timeout = new Promise((resolve) => setTimeout(resolve, 600));
107102
await timeout;
108103
await expect(page.locator('[data-sonner-toast]')).toHaveCount(0);

0 commit comments

Comments
 (0)