Skip to content

Commit a51a062

Browse files
committed
test(app-shell): two ResourceEditPage zh cases await the lazy studio zh catalogue
`discardDraftLabel-12690` finds the `丢弃草稿` button (`engine.edit.discardDraft`) and `environmentOverlay-12141` reads the read-only banner (`engine.edit.readOnlyTypeBanner`) in zh-CN. Both rows moved into the lazy `studio` namespace with the editor strings, so each case raced the zh chunk. Load the catalogue at module scope. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVTqmjzhQU2Rqq79mu
1 parent dc77e9c commit a51a062

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.discardDraftLabel-12690.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ import { MetadataResourceEditPage } from './ResourceEditPage';
103103
import { registerDefaultMetadataSchemas } from './default-schemas';
104104
import { registerBuiltinPreviews } from './previews';
105105
import { tFormat } from './i18n';
106+
// The `engine.edit.*` rows this suite reads in zh (the `丢弃草稿` button, the
107+
// confirm and the toast) live in `@object-ui/i18n`'s `studio` namespace, whose
108+
// `zh` catalogue is fetched on demand. Resident before any case, so the zh rows
109+
// are read after the catalogue lands, never racing it (objectstack#26863).
110+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
111+
await loadStudioCatalogue('zh');
106112

107113
const DOC_JSON_SCHEMA = z.toJSONSchema(DocSchema as unknown as z.ZodType) as Record<string, unknown>;
108114
client.current = new MetadataClient({ baseUrl: '', fetch: vi.fn(serve) as unknown as typeof fetch });

‎ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.environmentOverlay-12141.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ vi.mock('./i18n', async (importOriginal) => ({
7474
}));
7575

7676
import { MetadataResourceEditPage } from './ResourceEditPage';
77+
// The read-only banner (`engine.edit.readOnlyTypeBanner`) lives in
78+
// `@object-ui/i18n`'s `studio` namespace, whose `zh` catalogue is fetched on
79+
// demand. Resident before any case, so the zh banner is read after the
80+
// catalogue lands, never racing it (objectstack#26863).
81+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
82+
await loadStudioCatalogue('zh');
7783

7884
/** An item a code package ships, as the layered read serves it. */
7985
function packagedItem() {

0 commit comments

Comments
 (0)