From 0d1055fd08e6a05539724810a9007aca2722593e Mon Sep 17 00:00:00 2001 From: Ahmed Ghoneim Date: Mon, 18 Oct 2021 21:40:09 +0200 Subject: [PATCH] (chore): refactor Map.test.js to map.test.tsx (#43897) * chore: rename Map.test.js to map.test.tsx * chore: refactor Map.test.js to typescript --- .../__snapshots__/{Map.test.js.snap => map.test.tsx.snap} | 0 client/src/components/Map/{Map.test.js => map.test.tsx} | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) rename client/src/components/Map/__snapshots__/{Map.test.js.snap => map.test.tsx.snap} (100%) rename client/src/components/Map/{Map.test.js => map.test.tsx} (75%) diff --git a/client/src/components/Map/__snapshots__/Map.test.js.snap b/client/src/components/Map/__snapshots__/map.test.tsx.snap similarity index 100% rename from client/src/components/Map/__snapshots__/Map.test.js.snap rename to client/src/components/Map/__snapshots__/map.test.tsx.snap diff --git a/client/src/components/Map/Map.test.js b/client/src/components/Map/map.test.tsx similarity index 75% rename from client/src/components/Map/Map.test.js rename to client/src/components/Map/map.test.tsx index 947ecde5bd..18aa043991 100644 --- a/client/src/components/Map/Map.test.js +++ b/client/src/components/Map/map.test.tsx @@ -3,10 +3,14 @@ import { useStaticQuery } from 'gatsby'; import React from 'react'; import mockChallengeNodes from '../../__mocks__/challenge-nodes'; -import { Map } from './'; +import { Map } from '.'; + +const mockedUseStaticQuery = useStaticQuery as jest.MockedFunction< + typeof useStaticQuery +>; beforeEach(() => { - useStaticQuery.mockImplementationOnce(() => ({ + mockedUseStaticQuery.mockImplementationOnce(() => ({ allChallengeNode: { nodes: mockChallengeNodes }