Project Grid Item Component
Overview
This test suite verifies the UI of the ProjectGridItem
component.
Test Cases
Test: Renders correctly
- Description: Verifies that the component of project grid item is rendered successfully.
- Setup:
ProjectGridItem
component is rendered. - Expectation: Users should be able to see the grid card details.
- Assertion 1: Project name is present in the rendered component.
- Assertion 2: Project description is present in the rendered component.
- Assertion 3: Project last modified is present in the rendered component.
- Assertion 4:
Project Image (
getByAltText: project.name
) is present in the rendered component.
Test: Edit/Delete Button show for for admin role
- Description: Verifies that the edit/delete button is only shown for admin permission/role.
- Setup:
ProjectGridItem
component is rendered and user's role set to admin. - Expectation: Admin should be able to see and interact with Edit/Delete button.
- Assertion:
Edit/Delete Button (
grid-item-{project.id}
) is present in the rendered component.
- Assertion:
Edit/Delete Button (
Test: Edit/Delete Button doesn't show for user role
- Description: Verifies that the edit/delete button is not shown for user permission/role.
- Setup:
ProjectGridItem
component is rendered and user's role set to user. - Expectation: User shouldn't be able to see and interact with Edit/Delete button.
- Assertion:
Edit/Delete Button (
grid-item-{project.id}
) is not present in the rendered component.
- Assertion:
Edit/Delete Button (