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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user