From 2e7c9bb3e597b4a85b4073ecf7d56f58e6f7febb Mon Sep 17 00:00:00 2001 From: edvardds <edvardds@stud.ntnu.no> Date: Thu, 24 Sep 2020 12:58:58 +0200 Subject: [PATCH] added another snapshot test --- frontend/src/__tests__/DropDown.snapshot.test.tsx | 10 ++++++++++ .../__snapshots__/ArtPage.snapshot.test.tsx.snap | 2 ++ .../__snapshots__/DropDown.snapshot.test.tsx.snap | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 frontend/src/__tests__/DropDown.snapshot.test.tsx create mode 100644 frontend/src/__tests__/__snapshots__/DropDown.snapshot.test.tsx.snap diff --git a/frontend/src/__tests__/DropDown.snapshot.test.tsx b/frontend/src/__tests__/DropDown.snapshot.test.tsx new file mode 100644 index 0000000..18ab8d9 --- /dev/null +++ b/frontend/src/__tests__/DropDown.snapshot.test.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import DropDown from "../Components/DropDown" +import renderer from 'react-test-renderer' + +it('renders correctly', () => { + const tree = renderer + .create(<DropDown/>) + .toJSON(); + expect(tree).toMatchSnapshot() +}) diff --git a/frontend/src/__tests__/__snapshots__/ArtPage.snapshot.test.tsx.snap b/frontend/src/__tests__/__snapshots__/ArtPage.snapshot.test.tsx.snap index 592527d..1840173 100644 --- a/frontend/src/__tests__/__snapshots__/ArtPage.snapshot.test.tsx.snap +++ b/frontend/src/__tests__/__snapshots__/ArtPage.snapshot.test.tsx.snap @@ -57,6 +57,7 @@ exports[`renders correctly 1`] = ` className="navbutton left" > <img + alt="left" onClick={[Function]} src="left-arrow.png" style={ @@ -71,6 +72,7 @@ exports[`renders correctly 1`] = ` className="navbutton right" > <img + alt="right" onClick={[Function]} src="right-arrow.png" style={ diff --git a/frontend/src/__tests__/__snapshots__/DropDown.snapshot.test.tsx.snap b/frontend/src/__tests__/__snapshots__/DropDown.snapshot.test.tsx.snap new file mode 100644 index 0000000..6f60124 --- /dev/null +++ b/frontend/src/__tests__/__snapshots__/DropDown.snapshot.test.tsx.snap @@ -0,0 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders correctly 1`] = ` +<div + className="dropdown" +> + <span + className="settings-icon" + onClick={[Function]} + /> +</div> +`; -- GitLab