Skip to main content

SignOutConfirmation

Overview

This document outlines the test case for the SignOutConfirmation component. The SignOutConfirmation component handles the user's sign-out process, ensuring that the appropriate actions are taken to clear authentication data and close the confirmation modal. This test case verifies the component's behavior when a user confirms the sign-out action.

Test Case: Logout Success

  • Description: Tests the successful logout functionality of the SignOutConfirmation component.
  • Expected Outcome: When the 'Confirm' button is clicked, the following should occur:
    1. The AUTH_STORAGE_KEY and TOKEN_STORAGE_KEY items in localStorage should be removed.
    2. The authentication data in the queryClient should be cleared.
    3. The modals.closeAll function should be called to close the confirmation modal.

Steps:

  1. Set Up Initial State:
    • localStorage should have items set for TOKEN_STORAGE_KEY and AUTH_STORAGE_KEY.
  2. Render Component:
    • The SignOutConfirmation component should be rendered.
  3. Verify Initial Render:
    • The 'Confirm' button should be present in the DOM.
  4. Simulate User Action:
    • Simulate a click on the 'Confirm' button.
  5. Verify Final State:
    • The items for AUTH_STORAGE_KEY and TOKEN_STORAGE_KEY in localStorage should be null.
    • The authentication data in the queryClient should be null.
    • The modals.closeAll function should be called once.