From d035f6c52eff45136651cb0ba71c50423f0f7f3e Mon Sep 17 00:00:00 2001 From: I072513 Date: Thu, 14 Mar 2019 09:14:24 +0100 Subject: [PATCH 1/2] fix: Add unit tests for Spinner component --- .../components/Spinner/__tests__/Spinner.test.ts | 16 ++++++++++++++++ .../__tests__/__snapshots__/Spinner.test.ts.snap | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 ui/src/components/Spinner/__tests__/Spinner.test.ts create mode 100644 ui/src/components/Spinner/__tests__/__snapshots__/Spinner.test.ts.snap diff --git a/ui/src/components/Spinner/__tests__/Spinner.test.ts b/ui/src/components/Spinner/__tests__/Spinner.test.ts new file mode 100644 index 00000000..66de7dcc --- /dev/null +++ b/ui/src/components/Spinner/__tests__/Spinner.test.ts @@ -0,0 +1,16 @@ +import {shallowMount} from "@vue/test-utils" +import {Spinner} from "../" + +describe("Spinner", () => { + const spinner = shallowMount(Spinner, { + propsData: { + ariaLabel: "Label" + } + }); + test("renders correctly", () => { + expect(spinner.element).toMatchSnapshot(); + }); + test("renders correct props", () => { + expect(spinner.attributes("aria-label")).toEqual("Label") + }) +}) \ No newline at end of file diff --git a/ui/src/components/Spinner/__tests__/__snapshots__/Spinner.test.ts.snap b/ui/src/components/Spinner/__tests__/__snapshots__/Spinner.test.ts.snap new file mode 100644 index 00000000..c605db48 --- /dev/null +++ b/ui/src/components/Spinner/__tests__/__snapshots__/Spinner.test.ts.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Spinner renders correctly 1`] = ` +
+
+
+`; From 346f04136b5c9f8f1f74838ab30edc75d3f921cc Mon Sep 17 00:00:00 2001 From: I072513 Date: Thu, 14 Mar 2019 09:19:51 +0100 Subject: [PATCH 2/2] fixing lint errors --- .../Spinner/__tests__/Spinner.test.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/src/components/Spinner/__tests__/Spinner.test.ts b/ui/src/components/Spinner/__tests__/Spinner.test.ts index 66de7dcc..807960ad 100644 --- a/ui/src/components/Spinner/__tests__/Spinner.test.ts +++ b/ui/src/components/Spinner/__tests__/Spinner.test.ts @@ -1,16 +1,16 @@ -import {shallowMount} from "@vue/test-utils" -import {Spinner} from "../" +import { shallowMount } from "@vue/test-utils"; +import { Spinner } from "../"; describe("Spinner", () => { - const spinner = shallowMount(Spinner, { - propsData: { - ariaLabel: "Label" - } - }); - test("renders correctly", () => { - expect(spinner.element).toMatchSnapshot(); - }); - test("renders correct props", () => { - expect(spinner.attributes("aria-label")).toEqual("Label") - }) -}) \ No newline at end of file + const spinner = shallowMount(Spinner, { + propsData: { + ariaLabel: "Label" + } + }); + test("renders correctly", () => { + expect(spinner.element).toMatchSnapshot(); + }); + test("renders correct props", () => { + expect(spinner.attributes("aria-label")).toEqual("Label"); + }); +});