Skip to main content

UserProfileAccount

Overview

This document outlines the test cases for the UserProfileAccount component. The UserProfileAccount component displays and allows editing of the user's profile information. These test cases ensure that the component behaves correctly in various scenarios.

Test Case 1: Render with Initial Values

  • Description: Tests that the UserProfileAccount component renders with the initial values fetched from the social account.
  • Expected Outcome: The component should render the first name and last name input fields with the values John and Doe, respectively.

Test Case 2: Enable Save Button When Form is Dirty and Valid

  • Description: Tests that the Save button is enabled when the form is dirty (i.e., the user has made changes) and the form is valid.
  • Expected Outcome: The Save button should initially be disabled. When the user changes the first name input value to Jane, the Save button should become enabled.

Test Case 3: Disable Save Button When Form is Pending

  • Description: Tests that the Save button is disabled while the form submission is pending.
  • Expected Outcome: When the isPending state is true, the Save button should be disabled.

Test Case 4: Handle Form Submission

  • Description: Tests the form submission behavior of the UserProfileAccount component.
  • Expected Outcome: When the user changes the first name to Jane and the last name to Smith and clicks the Save button, the mutateAsync function should be called with the updated values firstName: 'Jane' and lastName: 'Smith'.