From 237236f8d7fa5705a0909c79c8c12c803b847149 Mon Sep 17 00:00:00 2001 From: Ryan Gossiaux Date: Sat, 25 Dec 2021 01:18:22 -0800 Subject: [PATCH] Add first test --- src/lib/components/switch/switch.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/lib/components/switch/switch.test.ts diff --git a/src/lib/components/switch/switch.test.ts b/src/lib/components/switch/switch.test.ts new file mode 100644 index 0000000..aefcbd8 --- /dev/null +++ b/src/lib/components/switch/switch.test.ts @@ -0,0 +1,15 @@ +import { render } from "@testing-library/svelte"; +import TestRenderer from "../../test-utils/TestRenderer.svelte"; +import { Switch } from "."; +jest.mock('../../hooks/use-id') + +describe('Safe guards', () => { + it('should be possible to render a Switch without crashing', () => { + render(TestRenderer, { + allProps: [ + Switch, + { checked: false, onChange: console.log } + ] + }); + }) +})