Skip to content

Commit dc77e9c

Browse files
committed
test(app-shell): PackageFormDialog validationTiming awaits the lazy studio zh catalogue
The zh-CN cases read `getByLabelText(/软件包 ID/)` right after the form renders; that label is `engine.packages.create.id`, a row of the lazy `studio` i18n namespace since the package/form/editor strings moved there. Load the zh catalogue at module scope, the shape the other studio-namespace zh tests in app-shell use. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVTqmjzhQU2Rqq79mu
1 parent a20824f commit dc77e9c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎ui/packages/app-shell/src/views/metadata-admin/PackageFormDialog.validationTiming.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ import * as React from 'react';
2020
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2121
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
2222
import { PackageFormDialog } from './PackageFormDialog';
23+
// The form's field labels (`engine.packages.create.*`) live in `@object-ui/i18n`'s
24+
// `studio` namespace, whose `zh` catalogue is fetched on demand. Resident before
25+
// any case, so `getByLabelText(/软件包 ID/)` reads the zh label, never the en
26+
// fallback while the chunk is in flight (objectstack#26863).
27+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
28+
await loadStudioCatalogue('zh');
2329

2430
let localeFixture: 'en-US' | 'zh-CN' = 'zh-CN';
2531
vi.mock('./i18n', async (importOriginal) => ({

0 commit comments

Comments
 (0)