fix terminal system lines to use server time
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { formatTerminalLogTime } from "./logTime";
|
||||
import { formatTerminalLogTime, formatTerminalServerTime } from "./logTime";
|
||||
|
||||
describe("formatTerminalLogTime", () => {
|
||||
it("uses the SCUM log clock instead of the browser timezone", () => {
|
||||
@@ -11,4 +11,9 @@ describe("formatTerminalLogTime", () => {
|
||||
it("falls back to the event timestamp for generic logs", () => {
|
||||
expect(formatTerminalLogTime("not-a-timestamp")).toBe("时间未知");
|
||||
});
|
||||
|
||||
it("does not use the browser clock before the server clock is synchronized", () => {
|
||||
expect(formatTerminalServerTime()).toBe("时间同步中");
|
||||
expect(formatTerminalServerTime("2026-08-14T00:00:00Z")).toBe(formatTerminalLogTime("2026-08-14T00:00:00Z"));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user