-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75f7918
commit 7d5d3ab
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
frontend/src/v2/features/ulam/components/element/__tests__/mission-create-dialog.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { render, screen, fireEvent } from '../../../../../../test-utils.tsx' | ||
import { describe, it, vi } from 'vitest' | ||
import MissionCreateDialog from '../mission-create-dialog.tsx' | ||
|
||
describe('MissionCreateDialog', () => { | ||
it('renders the dialog when isOpen is true', () => { | ||
render(<MissionCreateDialog isOpen={true} onClose={vi.fn()} />) | ||
expect(screen.getByText("Création d'un rapport de mission")).toBeInTheDocument() | ||
}) | ||
|
||
it('does not render the dialog when isOpen is false', () => { | ||
render(<MissionCreateDialog isOpen={false} onClose={vi.fn()} />) | ||
expect(screen.queryByText("Création d'un rapport de mission")).not.toBeInTheDocument() | ||
}) | ||
|
||
it('calls onClose when the close button is clicked', () => { | ||
const handleClose = vi.fn() | ||
render(<MissionCreateDialog isOpen={true} onClose={handleClose} />) | ||
|
||
fireEvent.click(screen.getByText('Annuler')) | ||
expect(handleClose).toHaveBeenCalled() | ||
}) | ||
}) |