Skip to content

Commit fac5ab6

Browse files
os-zhuangclaude
andcommitted
test(platform-objects): guard against a half-landed BU rename (i18n labels)
Asserts sys_business_unit / sys_business_unit_member object + field labels across all locales no longer retain the old 'department' term (the regression that the prior PR fixed). Labels only — field descriptions, the `kind` enum value 'department', and the multi-concept node descriptions are intentionally in scope-out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 61ed5c7 commit fac5ab6

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.changeset/bu-rename-guard-test.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
4+
test-only: regression guard asserting the ADR-0057 BU rename did not half-land — `sys_business_unit` / `sys_business_unit_member` object + field labels carry no stale "department" term across en/zh/ja/es. No runtime change.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
//
3+
// Regression guard for ADR-0057 (sys_department → sys_business_unit). The rename
4+
// once half-landed: the object label said "业务单元" while field labels still said
5+
// "上级部门" / "部门负责人". This asserts the object/plural label AND every FIELD
6+
// label across all locales no longer retains the old term.
7+
//
8+
// Scope is LABELS only — intentionally NOT field descriptions/help, NOT the `kind`
9+
// enum value `department` (a business unit can be OF KIND department), and NOT the
10+
// multi-concept node descriptions that list kinds. Those legitimately keep the word.
11+
12+
import { describe, it, expect } from 'vitest';
13+
import { enObjects } from './en.objects.generated.js';
14+
import { zhCNObjects } from './zh-CN.objects.generated.js';
15+
import { jaJPObjects } from './ja-JP.objects.generated.js';
16+
import { esESObjects } from './es-ES.objects.generated.js';
17+
18+
const LOCALES = [
19+
{ name: 'en', objs: enObjects as Record<string, any>, old: /\bDepartment\b/ },
20+
{ name: 'zh-CN', objs: zhCNObjects as Record<string, any>, old: // },
21+
{ name: 'ja-JP', objs: jaJPObjects as Record<string, any>, old: // },
22+
{ name: 'es-ES', objs: esESObjects as Record<string, any>, old: /Departamento/ },
23+
];
24+
const OBJECTS = ['sys_business_unit', 'sys_business_unit_member'];
25+
26+
describe('ADR-0057 BU rename — no stale "department" in object/field labels', () => {
27+
for (const { name, objs, old } of LOCALES) {
28+
for (const objName of OBJECTS) {
29+
it(`${name}: ${objName} object + field labels are fully renamed`, () => {
30+
const o = objs[objName];
31+
expect(o, `${objName} missing from ${name} bundle`).toBeTruthy();
32+
for (const key of ['label', 'pluralLabel'] as const) {
33+
if (o[key]) expect(String(o[key]), `${name} ${objName}.${key}`).not.toMatch(old);
34+
}
35+
for (const [fname, field] of Object.entries(o.fields ?? {})) {
36+
const label = (field as any)?.label;
37+
if (label) expect(String(label), `${name} ${objName}.fields.${fname}.label`).not.toMatch(old);
38+
}
39+
});
40+
}
41+
}
42+
});

0 commit comments

Comments
 (0)