From 9abcc06b647f09d51da4315155136692a7016601 Mon Sep 17 00:00:00 2001 From: Thehrz Date: Fri, 10 Feb 2023 21:24:16 +0800 Subject: [PATCH] Update test --- src/pages/_index.vue | 55 ----------------------- test/__snapshots__/component.test.ts.snap | 3 -- test/component.test.ts | 28 ------------ 3 files changed, 86 deletions(-) delete mode 100644 src/pages/_index.vue delete mode 100644 test/__snapshots__/component.test.ts.snap delete mode 100644 test/component.test.ts diff --git a/src/pages/_index.vue b/src/pages/_index.vue deleted file mode 100644 index 91a43b2..0000000 --- a/src/pages/_index.vue +++ /dev/null @@ -1,55 +0,0 @@ - diff --git a/test/__snapshots__/component.test.ts.snap b/test/__snapshots__/component.test.ts.snap deleted file mode 100644 index ea4d47c..0000000 --- a/test/__snapshots__/component.test.ts.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Vitest Snapshot v1 - -exports[`TheCounter.vue > should render 1`] = `"
10
"`; diff --git a/test/component.test.ts b/test/component.test.ts deleted file mode 100644 index a5bc63e..0000000 --- a/test/component.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { mount } from '@vue/test-utils' -import { describe, expect, it } from 'vitest' -import TheCounter from '../src/components/TheCounter.vue' - -describe('TheCounter.vue', () => { - it('should render', () => { - const wrapper = mount(TheCounter, { props: { initial: 10 } }) - expect(wrapper.text()).toContain('10') - expect(wrapper.html()).toMatchSnapshot() - }) - - it('should be interactive', async () => { - const wrapper = mount(TheCounter, { props: { initial: 0 } }) - expect(wrapper.text()).toContain('0') - - expect(wrapper.find('.inc').exists()).toBe(true) - - expect(wrapper.find('.dec').exists()).toBe(true) - - await wrapper.get('.inc').trigger('click') - - expect(wrapper.text()).toContain('1') - - await wrapper.get('.dec').trigger('click') - - expect(wrapper.text()).toContain('0') - }) -})