Clarify storage limits and unify file metadata displays

This commit is contained in:
2026-10-15 11:23:33 +09:00
parent 3786baf60c
commit 471e2653d8
22 changed files with 401 additions and 84 deletions

View File

@@ -150,20 +150,42 @@ try {
await admin.locator('.admin-file').filter({ hasText: 'sample.mp4' }).waitFor();
assert.match(await admin.locator('.admin-file').innerText(), /중국 · Beijing/);
assert.match(await admin.locator('.admin-file').innerText(), /1\.1\.1\.1/);
assert.match(await admin.locator('.admin-file-info').first().innerText(), /^\[.+\]\s+guest-/);
assert.match(await admin.locator('.admin-file').innerText(), /접속 지역 · 중국 · Beijing/);
assert.doesNotMatch(await admin.locator('.admin-file').innerText(), /최근 접속/);
assert.match(
await admin.locator('.admin-file footer small').innerText(),
/^\[보관 만료\] \d{4}년 \d{1,2}월 \d{1,2}일 \d{2}:\d{2} 까지$/,
);
await admin.getByRole('button', { name: '신규 업로드 중지', exact: true }).click();
await admin.getByText('신규 업로드 중지됨', { exact: true }).waitFor();
assert.equal(runtime.service.admin.state.uploadsPaused, true);
await admin.getByRole('button', { name: '업로드 재개', exact: true }).click();
await admin.getByText('신규 업로드 허용 중', { exact: true }).waitFor();
await admin.getByRole('button', { name: '접속 · 용량 설정', exact: true }).click();
assert.match(
await admin.locator('.admin-limit-details').innerText(),
/로그인 보관함[\s\S]*계정당 2\.1GB/,
);
assert.match(
await admin.locator('.admin-limit-details').innerText(),
/기기 전송 업로드[\s\S]*기기 세션당 2\.1GB/,
);
await admin.getByRole('button', { name: '설정 저장', exact: true }).click();
await admin.getByText('관리 설정을 저장했어요.', { exact: true }).waitFor();
assert.equal(
runtime.service.admin.state.totalStorageLimitMb,
20480,
'rounded GB presentation must not change the stored quota',
);
await admin.getByLabel('동시에 처리할 업로드 수').fill('3');
await admin.getByLabel('전체 파일 저장 한도 (GiB)').fill('16');
await admin.getByLabel('전체 파일 저장 한도 (GB)').fill('16');
await admin.getByLabel('차단할 국가 코드').fill('CN');
await admin.getByLabel('차단할 IP 또는 IP 대역').fill('9.9.9.0/24');
await admin.getByRole('button', { name: '설정 저장', exact: true }).click();
await admin.getByText('관리 설정을 저장했어요.', { exact: true }).waitFor();
assert.equal(runtime.service.admin.state.maxConcurrentUploads, 3);
assert.equal(runtime.service.admin.state.totalStorageLimitMb, 16384);
assert.equal(runtime.service.admin.state.totalStorageLimitMb, Math.round(16e9 / 1048576));
assert.deepEqual(runtime.service.admin.state.blockedCountries, ['CN']);
assert.equal(await sender.evaluate(async () => (await fetch('/api/device/me')).status), 403);
await admin.getByRole('button', { name: '저장 파일', exact: true }).click();

View File

@@ -414,9 +414,22 @@ try {
return { deviceId: session.device.id, ok: response.ok };
});
assert.equal(oldSession.ok, true);
await page.locator('.footer-device-summary').filter({ hasText: '발견 꺼짐' }).waitFor();
await page.waitForFunction(
() =>
!document
.querySelector('.footer-device-summary .device-state-dot')
?.classList.contains('enabled'),
);
await page.reload();
await page.locator('.footer-device-summary').filter({ hasText: '발견 허용' }).waitFor();
await page.waitForFunction(() =>
document
.querySelector('.footer-device-summary .device-state-dot')
?.classList.contains('enabled'),
);
assert.doesNotMatch(
await page.locator('.footer-device-summary').innerText(),
/발견 허용|발견 꺼짐/,
);
assert.equal(await page.locator('.footer-device-name').innerText(), '나의 테스트 기기');
assert.equal(
await page.evaluate(async () => (await (await fetch('/api/device/snapshot')).json()).device.id),

View File

@@ -247,7 +247,7 @@ try {
await sender.locator('.item-card').filter({ hasText: '나중에 읽을 글' }).waitFor();
assert.match(
await sender.locator('.item-footer > span').first().innerText(),
/^보관 만료 · .+까지$/,
/^\[보관 만료\] \d{4}년 \d{1,2}월 \d{1,2}일 \d{2}:\d{2} 까지$/,
);
await sender.getByRole('button', { name: '메모 수정', exact: true }).click();
await sender.getByLabel('한 줄 메모 수정').fill('업무 링크');

View File

@@ -112,7 +112,7 @@ try {
assert.equal(await card.getByText('기기 이름은 신원이 인증된 표시가 아닙니다.').count(), 0);
if (kind === 'file') {
await expect(card.locator('.request-file-size')).toHaveText(
size === 1700000000 ? '1.7 GB' : size === 100000 ? '0.1 MB' : '1.3 MB',
size === 1700000000 ? '1.7GB' : size === 100000 ? '100KB' : '1.3MB',
);
const spacing = await card.locator('.request-files').evaluate((el) => ({
padding: getComputedStyle(el).paddingLeft,
@@ -196,7 +196,7 @@ try {
assert.equal((await api(receiver, '/device/blocks')).blocks.length, 0);
assert.deepEqual(errors, []);
console.log(
'PASS: content icons/titles, desktop/mobile 2:1 buttons, single file sizes 0.1/1.3MB and 1.7GB, no list indent or overflow, retry countdown and draft preservation, block confirmation and private unblock UI.',
'PASS: content icons/titles, desktop/mobile 2:1 buttons, consistent single file sizes 100KB/1.3MB/1.7GB, no list indent or overflow, retry countdown and draft preservation, block confirmation and private unblock UI.',
);
} finally {
await browser?.close();