Skip to main content

Project List Item Component

Overview

This test suite verifies the UI of the ProjectListItem component.

Test Cases

Test: Renders correctly

  • Description: Verifies that the component of project list item is rendered successfully.
  • Setup: ProjectListItem component is rendered.
  • Expectation: Users should be able to see the list item 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: ProjectListItem 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 (list-item-{project.id}) is present in the rendered component.

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: ProjectListItem 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 (list-item-{project.id}) is not present in the rendered component.