mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
b1f199c4d7
Add yyyymmdd hhmm timestamps to cloud sync history and only show the green status dot when local changes are still pending upload. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
549 B
TypeScript
15 lines
549 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { formatLastSync, formatSyncDateTime } from './sync';
|
|
|
|
test('formatSyncDateTime renders yyyymmdd hhmm', () => {
|
|
const timestamp = new Date(2025, 5, 28, 14, 30, 0).getTime();
|
|
assert.equal(formatSyncDateTime(timestamp), '20250628 1430');
|
|
});
|
|
|
|
test('formatLastSync uses compact datetime for older timestamps', () => {
|
|
const twoHoursAgo = Date.now() - 2 * 60 * 60 * 1000;
|
|
const formatted = formatLastSync(twoHoursAgo);
|
|
assert.match(formatted, /^\d{8} \d{4}$/);
|
|
});
|