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:
- The
AUTH_STORAGE_KEY
andTOKEN_STORAGE_KEY
items inlocalStorage
should be removed. - The authentication data in the
queryClient
should be cleared. - The
modals.closeAll
function should be called to close the confirmation modal.
- The
Steps:
- Set Up Initial State:
localStorage
should have items set forTOKEN_STORAGE_KEY
andAUTH_STORAGE_KEY
.
- Render Component:
- The
SignOutConfirmation
component 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_KEY
andTOKEN_STORAGE_KEY
inlocalStorage
should benull
. - The authentication data in the
queryClient
should benull
. - The
modals.closeAll
function should be called once.
- The items for