From 9e90f0a7768001e34ac78ebd5ba55b0970766ad7 Mon Sep 17 00:00:00 2001 From: Alexander Shelepenok Date: Sat, 16 Apr 2022 14:49:57 +0000 Subject: [PATCH] chore(tests): fix errors in the icon component --- src/components/Icon/Icon.test.tsx | 4 ++-- src/components/Icon/__snapshots__/Icon.test.tsx.snap | 4 ++-- src/templates/IndexTemplate/IndexTemplate.test.tsx | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Icon/Icon.test.tsx b/src/components/Icon/Icon.test.tsx index 434eda9..edb020b 100644 --- a/src/components/Icon/Icon.test.tsx +++ b/src/components/Icon/Icon.test.tsx @@ -7,8 +7,8 @@ import { getIcon } from "@/utils"; describe("Icon", () => { it("renders correctly", () => { - const [github] = Object.keys(ICONS) as Array; - const props = { name: github, icon: getIcon(github) }; + const [twitter] = Object.keys(ICONS) as Array; + const props = { name: twitter, icon: getIcon(twitter) }; const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); diff --git a/src/components/Icon/__snapshots__/Icon.test.tsx.snap b/src/components/Icon/__snapshots__/Icon.test.tsx.snap index 4ed2741..305201e 100644 --- a/src/components/Icon/__snapshots__/Icon.test.tsx.snap +++ b/src/components/Icon/__snapshots__/Icon.test.tsx.snap @@ -5,10 +5,10 @@ exports[`Icon renders correctly 1`] = ` viewBox="0 0 26 28" > - github + twitter `; diff --git a/src/templates/IndexTemplate/IndexTemplate.test.tsx b/src/templates/IndexTemplate/IndexTemplate.test.tsx index 764c117..4babe95 100644 --- a/src/templates/IndexTemplate/IndexTemplate.test.tsx +++ b/src/templates/IndexTemplate/IndexTemplate.test.tsx @@ -12,7 +12,9 @@ const mockedUseStaticQuery = useStaticQuery as jest.Mock; describe("IndexTemplate", () => { beforeEach(() => { - mockedStaticQuery.mockImplementationOnce(({ render }) => render(mocks.siteMetadata)); + mockedStaticQuery.mockImplementationOnce(({ render }) => + render(mocks.siteMetadata), + ); mockedUseStaticQuery.mockReturnValue(mocks.siteMetadata); });