From 3825a9efad48f67fbb06229cd2f0306621f98c3e Mon Sep 17 00:00:00 2001 From: Craig Howell Date: Sun, 23 Oct 2022 13:19:24 -0400 Subject: [PATCH] fix(Accordion): removed data-testid for now fix(Accordion): removed vitest testing for now --- src/lib/components/accordion/Accordion.svelte | 1 - .../components/accordion/Accordion.test.ts | 85 ------------------- src/lib/components/accordion/Content.svelte | 1 - src/lib/components/accordion/Item.svelte | 1 - src/lib/components/accordion/Title.svelte | 1 - 5 files changed, 89 deletions(-) delete mode 100644 src/lib/components/accordion/Accordion.test.ts diff --git a/src/lib/components/accordion/Accordion.svelte b/src/lib/components/accordion/Accordion.svelte index 80b2d067..a6bf2aa3 100644 --- a/src/lib/components/accordion/Accordion.svelte +++ b/src/lib/components/accordion/Accordion.svelte @@ -11,7 +11,6 @@
{ - it('Renders with minimal props', async () => { - const { getByTestId } = render(Accordion); - expect(getByTestId('accordion')).toBeTruthy(); - }); - - it('Renders with all props', async () => { - const { getByTestId } = render(Accordion, { - props: { - class: 'bg-primary' - } - }); - expect(getByTestId('accordion')).toBeTruthy(); - expect(getByTestId('accordion').className).to.contain('bg-primary'); - }); -}); - -describe('Accordion.Item', () => { - it('Renders with minimal props', async () => { - const { getByTestId } = render(Accordion.Item); - expect(getByTestId('accordion.item')).toBeTruthy(); - }); - - it('Renders with all props', async () => { - const { getByTestId } = render(Accordion.Item, { - props: { - open: true, - class: 'bg-primary' - } - }); - expect(getByTestId('accordion.item')).toBeTruthy(); - expect(getByTestId('accordion.item').className).to.contain('bg-primary'); - }); -}); - -describe('Accordion.Item.Title', () => { - it('Renders with minimal props', async () => { - const { getByTestId } = render(Accordion.Item.Title); - expect(getByTestId('accordion.item.title')).toBeTruthy(); - }); - - it('Renders with all props', async () => { - const { getByTestId } = render(Accordion.Item.Title, { - props: { - class: 'bg-primary' - } - }); - expect(getByTestId('accordion.item.title')).toBeTruthy(); - expect(getByTestId('accordion.item.title').className).to.contain('bg-primary'); - }); - - it('Should be clickable', async () => { - const { getByTestId, component } = render(Accordion.Item.Title); - - const mock = vi.fn(); - const accordionItemTitle = getByTestId('accordion.item.title'); - - component.$on('click', mock); - fireEvent.click(accordionItemTitle); - - expect(mock).toHaveBeenCalled(); - }); -}); - -describe('Accordion.Item.Content', () => { - it('Renders with minimal props', async () => { - const { getByTestId } = render(Accordion.Item.Content); - expect(getByTestId('accordion.item.content')).toBeTruthy(); - }); - - it('Renders with all props', async () => { - const { getByTestId } = render(Accordion.Item.Content, { - props: { - class: 'bg-primary' - } - }); - expect(getByTestId('accordion.item.content')).toBeTruthy(); - expect(getByTestId('accordion.item.content').className).to.contain('bg-primary'); - }); -}); diff --git a/src/lib/components/accordion/Content.svelte b/src/lib/components/accordion/Content.svelte index 35201923..d8150075 100644 --- a/src/lib/components/accordion/Content.svelte +++ b/src/lib/components/accordion/Content.svelte @@ -13,7 +13,6 @@