From cefa597664b53b9134bb53db4848ce043affd709 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 10 Jan 2024 16:26:23 +0100 Subject: [PATCH] test(Button): import from `#components` --- test/components/elements/Button.spec.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/components/elements/Button.spec.ts b/test/components/elements/Button.spec.ts index 123011ce24..6dfb5040de 100644 --- a/test/components/elements/Button.spec.ts +++ b/test/components/elements/Button.spec.ts @@ -1,11 +1,8 @@ -// @vitest-environment nuxt import { describe, it, expect } from 'vitest' -import Button from '../../src/runtime/components/elements/Button.vue' +import { UButton } from '#components' import type { TypeOf } from 'zod' import ComponentRender from '../component-render' -type ButtonOptions = TypeOf - describe('Button', () => { it.each([ [ 'basic case', { } ], @@ -14,12 +11,12 @@ describe('Button', () => { [ 'rounded full', { props: { ui: { rounded: 'rounded-full' } } } ], [ '' ] // @ts-ignore - ])('renders %s correctly', async (nameOrHtml: string, options: ButtonOptions) => { + ])('renders %s correctly', async (nameOrHtml: string, options: TypeOf) => { if (options !== undefined) { options.slots = options.slots || { default: () => 'label' } options.slots.default = options.slots.default || (() => 'label') } - const html = await ComponentRender(nameOrHtml, options, Button) + const html = await ComponentRender(nameOrHtml, options, UButton) expect(html).toMatchSnapshot() }) })