test(dashboard): clear localStorage in MailboxModal beforeEach

The skeleton-loading test failed because earlier tests in the file
populated the SWR cache, so MailboxModal hydrated inbox from
localStorage and skipped the loading skeleton. Reset localStorage in
beforeEach so each test starts with a clean cache.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-19 17:57:10 -07:00
parent 24c15bc660
commit f55b051163

View File

@@ -129,6 +129,9 @@ const defaultProps = {
describe("MailboxModal", () => {
beforeEach(() => {
vi.clearAllMocks();
// Clear SWR cache between tests so prior runs don't pre-hydrate inbox/outbox
// state and mask the loading/empty/error UI assertions.
localStorage.clear();
mockUseMobileKeyboard.mockReturnValue({
keyboardOverlap: 0,
viewportHeight: null,