修改网盘显示等细节,登陆验证更加严格,同时允许一台设备在线
This commit is contained in:
32
front/src/admin/dashboard-state.test.ts
Normal file
32
front/src/admin/dashboard-state.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { getInviteCodePanelState } from './dashboard-state';
|
||||
|
||||
test('getInviteCodePanelState returns a copyable invite code when summary contains one', () => {
|
||||
assert.deepEqual(
|
||||
getInviteCodePanelState({
|
||||
totalUsers: 12,
|
||||
totalFiles: 34,
|
||||
inviteCode: ' AbCd1234 ',
|
||||
}),
|
||||
{
|
||||
inviteCode: 'AbCd1234',
|
||||
canCopy: true,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test('getInviteCodePanelState falls back to a placeholder when summary has no invite code', () => {
|
||||
assert.deepEqual(
|
||||
getInviteCodePanelState({
|
||||
totalUsers: 12,
|
||||
totalFiles: 34,
|
||||
inviteCode: ' ',
|
||||
}),
|
||||
{
|
||||
inviteCode: '未生成',
|
||||
canCopy: false,
|
||||
},
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user