Skip to content

Commit

Permalink
test: Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed May 10, 2024
1 parent 93e5e8d commit 8b18b38
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/storyMap/components/StoryMapForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ test('StoryMapForm: Change chapter location', async () => {
});

const locationDialogButton = within(chapter1).getByRole('button', {
name: 'Set Map Location',
name: 'Edit Map',
});
await act(async () => fireEvent.click(locationDialogButton));

Expand All @@ -728,9 +728,7 @@ test('StoryMapForm: Change chapter location', async () => {
await act(async () => map.onEvents['move']());

await act(async () =>
fireEvent.click(
within(dialog).getByRole('button', { name: 'Set Location' })
)
fireEvent.click(within(dialog).getByRole('button', { name: 'Save Map' }))
);

await waitFor(() => {
Expand Down Expand Up @@ -776,7 +774,7 @@ test('StoryMapForm: Change chapter style', async () => {
});

const locationDialogButton = within(chapter1).getByRole('button', {
name: 'Set Map Location',
name: 'Edit Map',
});
await act(async () => fireEvent.click(locationDialogButton));

Expand All @@ -792,12 +790,12 @@ test('StoryMapForm: Change chapter style', async () => {

await waitFor(() => {
expect(
screen.getByRole('button', { name: 'Set Location' })
screen.getByRole('button', { name: 'Save Map' })
).toBeInTheDocument();
});

await act(async () =>
fireEvent.click(screen.getByRole('button', { name: 'Set Location' }))
fireEvent.click(screen.getByRole('button', { name: 'Save Map' }))
);

await waitFor(() => {
Expand Down

0 comments on commit 8b18b38

Please sign in to comment.