From beb179ab1c7dd1b9488267e5bdd67a991518d559 Mon Sep 17 00:00:00 2001 From: Zachary Dixon Date: Tue, 19 Oct 2021 05:32:51 -0500 Subject: [PATCH] Removed duplicate map.test.tsx (#43924) * removed duplicate Map.test.tsx Co-authored-by: Oliver Eyton-Williams --- client/src/components/Map/Map.test.tsx | 27 - .../Map/__snapshots__/Map.test.tsx.snap | 499 ------------------ client/src/components/Map/map.test.tsx | 6 +- 3 files changed, 1 insertion(+), 531 deletions(-) delete mode 100644 client/src/components/Map/Map.test.tsx delete mode 100644 client/src/components/Map/__snapshots__/Map.test.tsx.snap diff --git a/client/src/components/Map/Map.test.tsx b/client/src/components/Map/Map.test.tsx deleted file mode 100644 index ebf24d4077..0000000000 --- a/client/src/components/Map/Map.test.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { render } from '@testing-library/react'; -import { useStaticQuery } from 'gatsby'; -import React from 'react'; - -import mockChallengeNodes from '../../__mocks__/challenge-nodes'; -import { Map } from './'; - -beforeEach(() => { - (useStaticQuery as jest.Mock).mockImplementationOnce(() => ({ - allChallengeNode: { - nodes: mockChallengeNodes - } - })); -}); - -// set .scrollTo to avoid errors in default test environment -window.scrollTo = jest.fn(); - -test(' snapshot', () => { - const { container } = render(); - - expect(container).toMatchSnapshot('Map'); -}); - -const props = { - forLanding: true -}; diff --git a/client/src/components/Map/__snapshots__/Map.test.tsx.snap b/client/src/components/Map/__snapshots__/Map.test.tsx.snap deleted file mode 100644 index 8af928ccf5..0000000000 --- a/client/src/components/Map/__snapshots__/Map.test.tsx.snap +++ /dev/null @@ -1,499 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` snapshot: Map 1`] = ` - -`; diff --git a/client/src/components/Map/map.test.tsx b/client/src/components/Map/map.test.tsx index 18aa043991..336608bdf0 100644 --- a/client/src/components/Map/map.test.tsx +++ b/client/src/components/Map/map.test.tsx @@ -5,12 +5,8 @@ import React from 'react'; import mockChallengeNodes from '../../__mocks__/challenge-nodes'; import { Map } from '.'; -const mockedUseStaticQuery = useStaticQuery as jest.MockedFunction< - typeof useStaticQuery ->; - beforeEach(() => { - mockedUseStaticQuery.mockImplementationOnce(() => ({ + (useStaticQuery as jest.Mock).mockImplementationOnce(() => ({ allChallengeNode: { nodes: mockChallengeNodes }