fix(小宝预警): 剩余工作量展示天数换算
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import type { VersionWithContext } from './derive';
|
||||
import { filterXiaobaoWarningVersions } from './xiaobao-warning-view';
|
||||
import { filterXiaobaoWarningVersions, formatRemainingWork } from './xiaobao-warning-view';
|
||||
|
||||
function version(patch: Partial<VersionWithContext> = {}): VersionWithContext {
|
||||
return {
|
||||
@@ -45,3 +45,10 @@ test('filterXiaobaoWarningVersions limits non-managers to versions where they ar
|
||||
|
||||
assert.deepEqual(result.map((item) => item.id), ['ver-1']);
|
||||
});
|
||||
|
||||
test('formatRemainingWork keeps hours and adds work-day conversion', () => {
|
||||
assert.equal(formatRemainingWork(0), '0h / 0天');
|
||||
assert.equal(formatRemainingWork(8), '8h / 1天');
|
||||
assert.equal(formatRemainingWork(12), '12h / 1.5天');
|
||||
assert.equal(formatRemainingWork(0.5), '0.5h / 0.1天');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user