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
SignOutConfirmationcomponent. - Expected Outcome: When the 'Confirm' button is clicked, the following should occur:
- The
AUTH_STORAGE_KEYandTOKEN_STORAGE_KEYitems inlocalStorageshould be removed. - The authentication data in the
queryClientshould be cleared. - The
modals.closeAllfunction should be called to close the confirmation modal.
- The
Steps:
- Set Up Initial State:
localStorageshould have items set forTOKEN_STORAGE_KEYandAUTH_STORAGE_KEY.
- Render Component:
- The
SignOutConfirmationcomponent should be rendered.
- The
- Verify Initial Render:
- The 'Confirm' button should be present in the DOM.
- Simulate User Action:
- Simulate a click on the 'Confirm' button.
- Verify Final State:
- The items for
AUTH_STORAGE_KEYandTOKEN_STORAGE_KEYinlocalStorageshould benull. - The authentication data in the
queryClientshould benull. - The
modals.closeAllfunction should be called once.
- The items for