From 21b52c485b58e0c01b9691f5ab84af6ac82f35e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 27 Mar 2024 12:14:02 +0100 Subject: [PATCH] Remove component IconSVG and add new icon test --- frontend/src/assets/icons/OcelotIcons.test.ts | 28 +++++++++++ .../__snapshots__/OcelotIcons.test.ts.snap} | 6 ++- frontend/src/components/IconSVG.test.ts | 46 ------------------- frontend/src/components/IconSVG.vue | 24 ---------- 4 files changed, 32 insertions(+), 72 deletions(-) create mode 100644 frontend/src/assets/icons/OcelotIcons.test.ts rename frontend/src/{components/__snapshots__/IconSVG.test.ts.snap => assets/icons/__snapshots__/OcelotIcons.test.ts.snap} (71%) delete mode 100644 frontend/src/components/IconSVG.test.ts delete mode 100644 frontend/src/components/IconSVG.vue diff --git a/frontend/src/assets/icons/OcelotIcons.test.ts b/frontend/src/assets/icons/OcelotIcons.test.ts new file mode 100644 index 000000000..684539c28 --- /dev/null +++ b/frontend/src/assets/icons/OcelotIcons.test.ts @@ -0,0 +1,28 @@ +import { mount } from '@vue/test-utils' +import { navigate } from 'vike/client/router' +import { describe, it, expect, beforeEach, vi } from 'vitest' +import { VIcon } from 'vuetify/components' + +vi.mock('vike/client/router') +vi.mocked(navigate).mockResolvedValue() + +describe('Ocelot Icons', () => { + const Wrapper = () => { + return mount(VIcon, { + props: { + icon: '$history', + color: 'green', + size: 'large', + }, + }) + } + let wrapper: ReturnType + + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders and tests if the ocelot icon "$history" is installed', () => { + expect(wrapper.element).toMatchSnapshot() + }) +}) diff --git a/frontend/src/components/__snapshots__/IconSVG.test.ts.snap b/frontend/src/assets/icons/__snapshots__/OcelotIcons.test.ts.snap similarity index 71% rename from frontend/src/components/__snapshots__/IconSVG.test.ts.snap rename to frontend/src/assets/icons/__snapshots__/OcelotIcons.test.ts.snap index bce169ac2..5f0268616 100644 --- a/frontend/src/components/__snapshots__/IconSVG.test.ts.snap +++ b/frontend/src/assets/icons/__snapshots__/OcelotIcons.test.ts.snap @@ -1,14 +1,16 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`IconSVG > renders and tests if the custom icons are installed 1`] = ` +exports[`Ocelot Icons > renders and tests if the ocelot icon "$history" is installed 1`] = `