隔离创作主页资源预览测试缓存 #395
@@ -12,6 +12,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { type ContextType, startTransition, Suspense } from 'react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { clearSignedAssetReadUrlCache } from '../../services/assetReadUrlService';
|
||||
import { AuthUiContext } from '../auth/AuthUiContext';
|
||||
import { CreationLandingView } from './CreationLandingView';
|
||||
|
||||
@@ -153,6 +154,7 @@ function SuspendAfterLandingRender({ active }: { active: boolean }) {
|
||||
|
||||
describe('CreationLandingView', () => {
|
||||
beforeEach(() => {
|
||||
clearSignedAssetReadUrlCache();
|
||||
listPublicEditorProjectResourcesMock.mockResolvedValue([]);
|
||||
});
|
||||
|
||||
@@ -161,6 +163,7 @@ describe('CreationLandingView', () => {
|
||||
listPublicEditorProjectResourcesMock.mockReset();
|
||||
createEditorProjectMock.mockReset();
|
||||
toggleEditorShowcaseAssetLikeMock.mockReset();
|
||||
clearSignedAssetReadUrlCache();
|
||||
vi.restoreAllMocks();
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user