feat(apes): Phase 1b — 补 apes:apps 信息层 tab (4 tab 齐活)
- tabs.tsx: +FiGrid icon, +AppsView placeholder, +apes:apps descriptor (order 902, profile 推到 903) - locales.ts: +apesApps/apesAppsTitle/apesAppsHint zh/en 4 key - tests: 3→4 tab 断言 (id 列表/contract/order 严格递增/disposer/i18n zh+en) 4 个 apes:* tab: tasks(900) / agents(901) / apps(902) / profile(903) gate: typecheck + build + test 1250 passed / 9 skipped / 0 failed (无回归)
This commit is contained in:
+13
-8
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* apes:* tab registration tests (Phase 1): the fork registers its three
|
||||
* information-layer tabs (tasks / agents / profile) through the same
|
||||
* apes:* tab registration tests (Phase 1/1b): the fork registers its four
|
||||
* information-layer tabs (tasks / agents / apps / profile) through the same
|
||||
* BetterSidebarService the upstream builtins use (dogfood). The spec pins
|
||||
* the registration contract (id / single / order / component presence) and
|
||||
* the isolated i18n contract (the apes namespace resolves zh vs en through
|
||||
@@ -31,11 +31,11 @@ function setup(): {
|
||||
}
|
||||
|
||||
describe('apes:* tab registrations', () => {
|
||||
it('registers the 3 apes tabs with the apes: namespace', () => {
|
||||
it('registers the 4 apes tabs with the apes: namespace', () => {
|
||||
const { service, dispose } = setup()
|
||||
try {
|
||||
expect(service.getTabs().map(t => t.id).sort()).toEqual(
|
||||
['apes:agents', 'apes:profile', 'apes:tasks'],
|
||||
['apes:agents', 'apes:apps', 'apes:profile', 'apes:tasks'],
|
||||
)
|
||||
} finally {
|
||||
dispose()
|
||||
@@ -45,7 +45,7 @@ describe('apes:* tab registrations', () => {
|
||||
it('every apes tab is single-instance, visible, and component-carrying', () => {
|
||||
const { service, dispose } = setup()
|
||||
try {
|
||||
for (const id of ['apes:tasks', 'apes:agents', 'apes:profile']) {
|
||||
for (const id of ['apes:tasks', 'apes:agents', 'apes:apps', 'apes:profile']) {
|
||||
const tab = service.getTab(id)
|
||||
expect(tab, `${id} registered`).toBeDefined()
|
||||
expect(tab?.single, `${id} single`).toBe(true)
|
||||
@@ -64,14 +64,17 @@ describe('apes:* tab registrations', () => {
|
||||
const orders = {
|
||||
tasks: service.getTab('apes:tasks')?.order,
|
||||
agents: service.getTab('apes:agents')?.order,
|
||||
apps: service.getTab('apes:apps')?.order,
|
||||
profile: service.getTab('apes:profile')?.order,
|
||||
}
|
||||
expect(orders.tasks).toBeGreaterThanOrEqual(900)
|
||||
expect(orders.agents).toBeGreaterThanOrEqual(900)
|
||||
expect(orders.apps).toBeGreaterThanOrEqual(900)
|
||||
expect(orders.profile).toBeGreaterThanOrEqual(900)
|
||||
// Strictly ordered: tasks < agents < profile.
|
||||
// Strictly ordered: tasks < agents < apps < profile.
|
||||
expect(orders.tasks!).toBeLessThan(orders.agents!)
|
||||
expect(orders.agents!).toBeLessThan(orders.profile!)
|
||||
expect(orders.agents!).toBeLessThan(orders.apps!)
|
||||
expect(orders.apps!).toBeLessThan(orders.profile!)
|
||||
} finally {
|
||||
dispose()
|
||||
}
|
||||
@@ -81,7 +84,7 @@ describe('apes:* tab registrations', () => {
|
||||
const store = createSidebarStore()
|
||||
const service = createBetterSidebarService(store)
|
||||
const dispose = registerApesTabs({} as Context, service)
|
||||
expect(service.getTabs()).toHaveLength(3)
|
||||
expect(service.getTabs()).toHaveLength(4)
|
||||
dispose()
|
||||
expect(service.getTabs()).toHaveLength(0)
|
||||
})
|
||||
@@ -101,6 +104,7 @@ describe('apes i18n contract', () => {
|
||||
attachApesLocale({ getSnapshot: () => ({ active: 'zh-CN' }) })
|
||||
expect(t('apesTasks')).toBe('任务')
|
||||
expect(t('apesAgents')).toBe('智能体')
|
||||
expect(t('apesApps')).toBe('应用')
|
||||
expect(t('apesProfile')).toBe('画像')
|
||||
})
|
||||
|
||||
@@ -108,6 +112,7 @@ describe('apes i18n contract', () => {
|
||||
attachApesLocale({ getSnapshot: () => ({ active: 'en' }) })
|
||||
expect(t('apesTasks')).toBe('Tasks')
|
||||
expect(t('apesAgents')).toBe('Agents')
|
||||
expect(t('apesApps')).toBe('Apps')
|
||||
expect(t('apesProfile')).toBe('Profile')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user