diff --git a/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx b/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx
index dd8d2713..03be6427 100644
--- a/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx
+++ b/src/Components/Profile/Subcomponents/GalleryForm.spec.tsx
@@ -83,11 +83,17 @@ describe('GalleryForm', () => {
expect(wrapper.container).toMatchSnapshot()
})
- it('can delete an image', () => {
+ it('can open and close delete modal', () => {
Wrapper({ gallery })
- const deleteButton = screen.getByTestId('delete-image-1')
+ const deleteButton = screen.getAllByTestId('trash')[0]
expect(deleteButton).toBeInTheDocument()
fireEvent.click(deleteButton)
+ const confirmationText = screen.getByText('Do you want to delete this image?')
+ expect(confirmationText).toBeInTheDocument()
+ const confirmButton = screen.getByText('Yes')
+ expect(confirmButton).toBeInTheDocument()
+ fireEvent.click(confirmButton)
+ expect(confirmationText).not.toBeInTheDocument()
})
})
diff --git a/src/Components/Profile/Subcomponents/GalleryForm.tsx b/src/Components/Profile/Subcomponents/GalleryForm.tsx
index 82c2449d..f808450f 100644
--- a/src/Components/Profile/Subcomponents/GalleryForm.tsx
+++ b/src/Components/Profile/Subcomponents/GalleryForm.tsx
@@ -111,7 +111,7 @@ export const GalleryForm = ({ state, setState }: Props) => {
onClick={() => setImageSelectedToDelete(index)}
type='button'
>
-