diff --git a/frontend/src/components/CardBoard/CardBody/DuplicateBoardNameDialog.spec.tsx b/frontend/src/components/CardBoard/CardBody/DuplicateBoardNameDialog.spec.tsx
index 5efcfe64a..b67a70eaf 100644
--- a/frontend/src/components/CardBoard/CardBody/DuplicateBoardNameDialog.spec.tsx
+++ b/frontend/src/components/CardBoard/CardBody/DuplicateBoardNameDialog.spec.tsx
@@ -2,9 +2,8 @@ import React from 'react';
import { libraryMocks } from '@/utils/testing/mocks';
import { renderWithProviders } from '@/utils/testing/renderWithProviders';
import { UserFactory } from '@/utils/factories/user';
-import { fireEvent, waitFor } from '@testing-library/react';
+import { fireEvent, waitFor, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import { act } from 'react-dom/test-utils';
import DuplicateBoardNameDialog, {
DuplicateBoardNameDialogProps,
} from './DuplicateBoardNameDialog';
diff --git a/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.spec.tsx b/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.spec.tsx
index 8b49b2a6c..22ad49494 100644
--- a/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.spec.tsx
+++ b/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.spec.tsx
@@ -4,43 +4,47 @@ import { UserListFactory } from '@/utils/factories/user';
import { fireEvent, waitFor } from '@testing-library/react';
import UserListDialog, { UserListDialogProps } from './UserListDialog';
-const DEFAULT_PROPS = {
- usersList: UserListFactory.createMany(3),
- setIsOpen: jest.fn(),
- isOpen: true,
- confirmationHandler: jest.fn(),
-};
-
const router = createMockRouter({});
-const render = (props: UserListDialogProps = DEFAULT_PROPS) =>
- renderWithProviders(, { routerOptions: router });
+const render = (props: Partial = {}) =>
+ renderWithProviders(
+ ,
+ { routerOptions: router },
+ );
describe('Components/Primitives/Dialogs/UserListDialog', () => {
it('should render correctly', () => {
// Arrange
- const testProps = { ...DEFAULT_PROPS };
+ const usersList = UserListFactory.createMany(3);
// Act
- const { getAllByTestId, getByTestId } = render(testProps);
+ const { getAllByTestId, getByTestId } = render({ usersList });
// Assert
- expect(getAllByTestId('checkboxUserItem')).toHaveLength(testProps.usersList.length);
+ expect(getAllByTestId('checkboxUserItem')).toHaveLength(usersList.length);
expect(getByTestId('searchInput')).toBeInTheDocument();
});
it('should call confirmationHandler function', async () => {
// Arrange
- const testProps = { ...DEFAULT_PROPS };
+ const confirmationHandler = jest.fn();
// Act
- const { getByTestId } = render(testProps);
+ const { getByTestId } = render({ confirmationHandler });
// Assert
fireEvent.click(getByTestId('dialogFooterSubmit'));
await waitFor(() => {
- expect(testProps.confirmationHandler).toBeCalled();
+ expect(confirmationHandler).toBeCalled();
});
});
});
diff --git a/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.tsx b/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.tsx
index c5b3c4ed5..d76497d3b 100644
--- a/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.tsx
+++ b/frontend/src/components/Primitives/Dialogs/UserListDialog/UserListDialog.tsx
@@ -107,63 +107,65 @@ const UserListDialog = React.memo(
return (
);
},
diff --git a/frontend/src/components/Teams/CreateTeam/CreateTeam.spec.tsx b/frontend/src/components/Teams/CreateTeam/CreateTeam.spec.tsx
new file mode 100644
index 000000000..36bc72101
--- /dev/null
+++ b/frontend/src/components/Teams/CreateTeam/CreateTeam.spec.tsx
@@ -0,0 +1,32 @@
+import { renderWithProviders } from '@/utils/testing/renderWithProviders';
+import { fireEvent, waitFor } from '@testing-library/react';
+import CreateTeam from './CreateTeam';
+
+const render = () => renderWithProviders();
+
+describe('Teams/CreateTeam', () => {
+ it('should render correctly', () => {
+ // Act
+ const { getByTestId, queryByLabelText } = render();
+
+ // Assert
+ expect(getByTestId('createHeader')).toBeInTheDocument();
+ expect(getByTestId('createFooter')).toBeInTheDocument();
+ expect(getByTestId('tipbar')).toBeInTheDocument();
+ expect(queryByLabelText('Team name')).toBeInTheDocument();
+ expect(getByTestId('addRemoveMembersTrigger')).toBeInTheDocument();
+ expect(getByTestId('teamMembersList')).toBeInTheDocument();
+ });
+
+ it('should open a UserListDialog', async () => {
+ // Act
+ const { getByTestId } = render();
+
+ // Assert
+ fireEvent.click(getByTestId('addRemoveMembersTrigger'));
+
+ await waitFor(() => {
+ expect(getByTestId('userListDialog')).toBeInTheDocument();
+ });
+ });
+});
diff --git a/frontend/src/components/Teams/CreateTeam/CreateTeam.tsx b/frontend/src/components/Teams/CreateTeam/CreateTeam.tsx
index c96a2a84f..31b15b299 100644
--- a/frontend/src/components/Teams/CreateTeam/CreateTeam.tsx
+++ b/frontend/src/components/Teams/CreateTeam/CreateTeam.tsx
@@ -107,7 +107,12 @@ const CreateTeam = () => {
Team Members
-