From 13dd0525541929fb4c04dc388cce4bb1e9f4bc4e Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Mon, 21 Jul 2025 12:28:37 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20Added=20displaying=20label?= =?UTF-8?q?=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/VLink.spec.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/VLink.spec.ts diff --git a/test/VLink.spec.ts b/test/VLink.spec.ts new file mode 100644 index 0000000..a437551 --- /dev/null +++ b/test/VLink.spec.ts @@ -0,0 +1,24 @@ +import { mount } from '@vue/test-utils' +import VLink from '../src/components/button/VLink.vue' +import {test, expect, describe} from 'vitest' + +describe('VLink', () => { + test('renders the label correctly', () => { + const wrapper = mount(VLink, { + props: { + label: 'Link' + } + }) + expect(wrapper.text()).toContain('Link'); + }) + + test('renders as an anchor tag when `href` is provided', () => { + const wrapper = mount(VLink, { + props: {label: 'External', href: 'https://example.com' } + }); + + const a = wrapper.find('a') + expect(a.exists()).toBe(true); + expect(a.attributes('href')).toBe('https://example.com'); + }) +})