diff --git a/client/src/components/Map/Map.test.tsx b/client/src/components/Map/Map.test.tsx new file mode 100644 index 0000000000..ebf24d4077 --- /dev/null +++ b/client/src/components/Map/Map.test.tsx @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000000..8af928ccf5 --- /dev/null +++ b/client/src/components/Map/__snapshots__/Map.test.tsx.snap @@ -0,0 +1,499 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` snapshot: Map 1`] = ` +
+ +
+`;