Project List Component
Overview
This test suite verifies the UI of the ProjectList
component.
Test Cases
Test: Renders grid layout correctly
- Description: Verifies the layout of grid when grid button is clicked.
- Setup:
useProjectQuery
hook is mocked and TheProjectList
component is rendered. - Expectation: Users should be able to click the grid button and see the grid layout of items/skeletons.
- Assertion :
Grid layout(
grid-view
) is present in the rendered component.
- Assertion :
Grid layout(
Test: Renders grid item correctly
- Description: Verifies the grid item exists when grid layout is chosen.
- Setup:
useProjectQuery
hook is mocked and TheProjectList
component is rendered. - Expectation: Users should be able to see the project items in grid layout.
- Assertion :
Every grid items(
grid-card-${project.id}
) are present in the rendered component.
- Assertion :
Every grid items(
Test: Renders grid skeleton correctly
- Description: Verifies the skeleton for grid layout exists.
- Setup:
useProjectQuery
hook is mocked withisLoading = True
and theProjectList
component is rendered. - Expectation: Users should be able to see the skeletons in grid layout.
- Assertion :
Grid skeletons(
project-grid-skeleton
) are present in the rendered component.
- Assertion :
Grid skeletons(
Test: Renders list layout correctly
- Description: Verifies the layout of list when list button is clicked.
- Setup:
useProjectQuery
hook is mocked and TheProjectList
component is rendered. - Expectation: Users should be able to click the list button and see the list layout of items/skeletons.
- Assertion :
List layout(
list-view
) is present in the rendered component.
- Assertion :
List layout(
Test: Renders list item correctly
- Description: Verifies the list item exists when list layout is chosen.
- Setup:
useProjectQuery
hook is mocked and TheProjectList
component is rendered. - Expectation: Users should be able to see the project items in list layout.
- Assertion :
Every list items(
list-${project.id}
) are present in the rendered component.
- Assertion :
Every list items(
Test: Renders list skeleton correctly
- Description: Verifies the skeleton for list layout exists.
- Setup:
useProjectQuery
hook is mocked withisLoading = True
and theProjectList
component is rendered. - Expectation: Users should be able to see the skeletons in list layout.
- Assertion :
List skeletons(
project-list-skeleton
) are present in the rendered component.
- Assertion :
List skeletons(
Test: Open project form modal when clicking add project
- Description: Verifies that project form modal is opened when clicking add project button.
- Setup:
useProjectQuery
hook is mocked and theProjectList
component is rendered. - Expectation: Users should be able to see a project form modal popup after clicking the add project button.
- Assertion :
Project Form Modal(
project-form-modal
) is present in the rendered component.
- Assertion :
Project Form Modal(