Refactor modal tests for improved clarity and consistency in content and actions

This commit is contained in:
2025-06-29 16:06:35 +02:00
parent 8d9222d084
commit 32d03347fc
12 changed files with 122 additions and 80 deletions

View File

@@ -89,8 +89,8 @@ describe('CreateWorkspaceModal', () => {
mockUseModalContext.mockReturnValue(mockModalContext);
});
describe('Modal Visibility and Basic Interaction', () => {
it('renders modal with form elements when visible', () => {
describe('Modal Visibility and Content', () => {
it('renders modal with correct content when opened', () => {
render(
<CreateWorkspaceModal onWorkspaceCreated={mockOnWorkspaceCreated} />
);
@@ -119,8 +119,10 @@ describe('CreateWorkspaceModal', () => {
screen.queryByText('Create New Workspace')
).not.toBeInTheDocument();
});
});
it('closes modal when cancel button is clicked', () => {
describe('User Actions', () => {
it('calls onClose when cancel button is clicked', () => {
render(
<CreateWorkspaceModal onWorkspaceCreated={mockOnWorkspaceCreated} />
);
@@ -268,7 +270,7 @@ describe('CreateWorkspaceModal', () => {
});
});
describe('Successful Workspace Creation', () => {
describe('Workspace Creation Flow', () => {
it('completes full successful creation flow', async () => {
render(
<CreateWorkspaceModal onWorkspaceCreated={mockOnWorkspaceCreated} />