Skip to content

Commit 50adaba

Browse files
Copilothotlong
andcommitted
Improve SpecCompliance test to validate I18nLabel shape
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent ebbfca8 commit 50adaba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/console/src/__tests__/SpecCompliance.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ describe('ObjectStack Spec v0.9.0 Compliance', () => {
2626
expect(typeof app.name).toBe('string');
2727
expect(app.label).toBeDefined();
2828
expect(['string', 'object']).toContain(typeof app.label);
29+
if (typeof app.label === 'object') {
30+
expect(app.label).toHaveProperty('key');
31+
}
2932

3033
// Name convention: lowercase snake_case
3134
expect(app.name).toMatch(/^[a-z][a-z0-9_]*$/);
@@ -37,6 +40,9 @@ describe('ObjectStack Spec v0.9.0 Compliance', () => {
3740
// Optional fields that should be defined if present
3841
if (app.description) {
3942
expect(['string', 'object']).toContain(typeof app.description);
43+
if (typeof app.description === 'object') {
44+
expect(app.description).toHaveProperty('key');
45+
}
4046
}
4147
if (app.version) {
4248
expect(typeof app.version).toBe('string');

0 commit comments

Comments
 (0)