Skip to content

Commit

Permalink
fix: Fixed test, removed not needed import
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Jun 10, 2024
1 parent b5c0e27 commit 60b9525
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 59 deletions.
44 changes: 0 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@turf/bbox": "^6.5.0",
"@turf/center": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/intersect": "^6.5.0",
"canvg": "^4.0.2",
"filesize": "^10.1.2",
"get-video-id": "^4.1.5",
Expand Down
27 changes: 13 additions & 14 deletions src/storyMap/components/StoryMapForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ beforeEach(() => {
useAnalytics.mockReturnValue({
trackEvent: jest.fn(),
});
when(terrasoApi.requestGraphQL)
.calledWith(expect.stringContaining('query visualizationConfigs'))
.mockResolvedValue({
visualizationConfigs: {
edges: [
{
node: VISUALIZATION_CONFIG,
},
],
},
});
});

const setup = async config => {
Expand Down Expand Up @@ -823,18 +834,6 @@ test('StoryMapForm: Add data layer', async () => {
};
mapboxgl.Map.mockReturnValue(map);

when(terrasoApi.requestGraphQL)
.calledWith(expect.stringContaining('query visualizationConfigs'))
.mockResolvedValue({
visualizationConfigs: {
edges: [
{
node: VISUALIZATION_CONFIG,
},
],
},
});

const { onSaveDraft } = await setup(BASE_CONFIG);

const chapter1 = screen.getByRole('region', {
Expand All @@ -856,7 +855,7 @@ test('StoryMapForm: Add data layer', async () => {
await act(async () => fireEvent.click(addDataLayerButton));

const dataMapDialog = screen.getByRole('dialog', {
name: 'Add a data layer to Chapter 1',
name: 'Add a map layer to Chapter 1',
});

const dataLayerItem = within(dataMapDialog).getByRole('listitem', {
Expand All @@ -867,7 +866,7 @@ test('StoryMapForm: Add data layer', async () => {
await act(async () => fireEvent.click(radioButton));

const addMapButton = within(dataMapDialog).getByRole('button', {
name: 'Add Map',
name: 'Add Map Layer',
});
await act(async () => fireEvent.click(addMapButton));

Expand Down

0 comments on commit 60b9525

Please sign in to comment.