fix(workspace): 兼容成员ID匹配与我相关任务

This commit is contained in:
2026-07-06 11:22:43 +08:00
parent 84344e81f6
commit b170ac9caf
4 changed files with 56 additions and 18 deletions

View File

@@ -91,3 +91,30 @@ test('aggregateWorkItems uses direct version id for no-requirement dev tasks', (
assert.equal(items[0].versionId, 'ver-1');
assert.equal(items[0].versionName, 'V1.0');
});
test('aggregateWorkItems matches V2.2 member ids as current user references', () => {
const items = aggregateWorkItems(
['超级管理员', 'm-8'],
[{
id: 'plan-1',
versionId: 'ver-1',
type: 'product',
title: '案例学习 V1.3 产品方案',
owner: 'm-8',
startTime: '2026-07-06T09:00:00.000Z',
endTime: '2026-07-06T18:00:00.000Z',
status: 'pending',
tasks: [],
createdAt: '2026-07-06T09:00:00.000Z',
} as any],
[],
[],
[],
new Map([['ver-1', { id: 'ver-1', name: '案例学习V1.3', productName: '案例学习', projectName: '案例学习' }]]),
new Map(),
);
assert.equal(items.length, 1);
assert.equal(items[0].type, 'plan_product');
assert.equal(items[0].title, '案例学习 V1.3 产品方案');
});