From a2bee677578a16471ed5f1eaf4802aa7c99acd09 Mon Sep 17 00:00:00 2001 From: Bastian Meissner Date: Mon, 14 Jun 2021 13:19:39 +0200 Subject: [PATCH] Fix style --- src/test/components/greeter.spec.tsx | 50 +++++++++++++++------------- src/test/components/icon.spec.tsx | 28 ++++++++-------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/test/components/greeter.spec.tsx b/src/test/components/greeter.spec.tsx index 45791e9..49818fa 100644 --- a/src/test/components/greeter.spec.tsx +++ b/src/test/components/greeter.spec.tsx @@ -1,5 +1,9 @@ import { render } from "@testing-library/react"; -import Greeter, { IGreeterProps, isBetween, getExtension } from "../../components/greeter"; +import Greeter, { + IGreeterProps, + isBetween, + getExtension, +} from "../../components/greeter"; const props: IGreeterProps = { months: [ @@ -14,7 +18,7 @@ const props: IGreeterProps = { "September", "October", "November", - "December" + "December", ], days: [ "Sunday", @@ -23,7 +27,7 @@ const props: IGreeterProps = { "Wednesday", "Thursday", "Friday", - "Saturday" + "Saturday", ], greetings: [ { @@ -39,33 +43,33 @@ const props: IGreeterProps = { { greeting: "Good afternoon!", start: 12, - end: 18 + end: 18, }, { greeting: "Good evening!", start: 18, - end: 24 - } + end: 24, + }, ], - dateformat: "%wd, %m %d%e %y" -} + dateformat: "%wd, %m %d%e %y", +}; -it('isBetween test', () => { - expect(isBetween(5,1,3)).toBeFalsy - expect(isBetween(64,1,8)).toBeFalsy - expect(isBetween(-1,-5,-3)).toBeFalsy - expect(isBetween(4,4,4)).toBeTruthy - expect(isBetween(3,1,8)).toBeTruthy - expect(isBetween(-3,-5,-1)).toBeTruthy -}) +it("isBetween test", () => { + expect(isBetween(5, 1, 3)).toBeFalsy; + expect(isBetween(64, 1, 8)).toBeFalsy; + expect(isBetween(-1, -5, -3)).toBeFalsy; + expect(isBetween(4, 4, 4)).toBeTruthy; + expect(isBetween(3, 1, 8)).toBeTruthy; + expect(isBetween(-3, -5, -1)).toBeTruthy; +}); -it('getExtension test', () => { - expect(getExtension(1)).toEqual("st") - expect(getExtension(2)).toEqual("nd") - expect(getExtension(3)).toEqual("rd") - expect(getExtension(4)).toEqual("th") - expect(getExtension(55)).toEqual("th") -}) +it("getExtension test", () => { + expect(getExtension(1)).toEqual("st"); + expect(getExtension(2)).toEqual("nd"); + expect(getExtension(3)).toEqual("rd"); + expect(getExtension(4)).toEqual("th"); + expect(getExtension(55)).toEqual("th"); +}); it("Greeter snapshot test", () => { const { asFragment } = render(); diff --git a/src/test/components/icon.spec.tsx b/src/test/components/icon.spec.tsx index da75ac2..3a44a1d 100644 --- a/src/test/components/icon.spec.tsx +++ b/src/test/components/icon.spec.tsx @@ -1,23 +1,25 @@ import { fireEvent, render, screen } from "@testing-library/react"; -import Icon, { IconButton } from "../../components/icon" +import Icon, { IconButton } from "../../components/icon"; const props = { name: "bug_report", size: "20px", - onClick: () => console.log("test") -} + onClick: () => console.log("test"), +}; -it('Icon test', () => { - const { asFragment } = render(); +it("Icon test", () => { + const { asFragment } = render(); expect(asFragment).toMatchSnapshot(); -}) +}); -it('IconButton test', () => { - const { asFragment } = render(); +it("IconButton test", () => { + const { asFragment } = render( + , + ); expect(asFragment).toMatchSnapshot(); - - const handleClick = jest.fn() + + const handleClick = jest.fn(); render(); - fireEvent.click(screen.getByText(/question_answer/i)) - expect(handleClick).toHaveBeenCalledTimes(1) -}) \ No newline at end of file + fireEvent.click(screen.getByText(/question_answer/i)); + expect(handleClick).toHaveBeenCalledTimes(1); +});