The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): preserve changelog semantics across locale labels
brooklyn!af63503a0ff2
diff --git a/apps/desktop/src/lib/commit-changelog-localization.test.ts b/apps/desktop/src/lib/commit-changelog-localization.test.tsnew file mode 100644index 00000000000..4f9e7fd9e67--- /dev/null+++ b/apps/desktop/src/lib/commit-changelog-localization.test.ts@@ -0,0 +1,25 @@+import { describe, expect, it } from 'vitest'++import { buildCommitChangelog } from './commit-changelog'++describe('changelog display copy', () => {+ it('overrides labels without changing grouping, ordering or authored subjects', () => {+ const commits = ['feat: A', 'fix: B', 'perf: C', 'refactor: D', 'misc: E'].map(summary => ({ summary }))+ const labels = { new: '新增', fixed: '修复', faster: '更快', improved: '改进', other: '其他改进' }+ const defaults = buildCommitChangelog(commits, { maxGroups: 5 })+ const localized = buildCommitChangelog(commits, { maxGroups: 5, labels })+ expect(localized).toEqual(defaults.map(group => ({ ...group, label: labels[group.id] })))+ const partial = buildCommitChangelog(commits, { maxGroups: 5, labels: { new: labels.new } })+ expect(partial).toEqual(defaults.map(group => ({ ...group, label: group.id === 'new' ? labels.new : group.label })))+ })++ it('uses caller fallback copy only when no user-facing commits remain', () => {+ const fallback = { label: '本次更新', item: '改进与修复' }++ for (const commits of [undefined, [], [{ summary: 'chore: internal' }]]) {+ expect(buildCommitChangelog(commits, { fallback })).toEqual([{ id: 'other', label: fallback.label, items: [fallback.item] }])+ }++ expect(buildCommitChangelog([{ summary: 'fix: real change' }], { fallback })[0].items).toEqual(['Real change'])+ })+})