19 lines
575 B
TypeScript
19 lines
575 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { demoSessions } from "./protocol/fixtures";
|
|
import { toSessionRow } from "./sessionPresentation";
|
|
|
|
describe("toSessionRow", () => {
|
|
it("将协议 Session 转换为稳定的表格展示值", () => {
|
|
expect(toSessionRow(demoSessions[0], new Date("2026-08-03T19:12:02Z"))).toEqual({
|
|
id: "NW-042",
|
|
status: "ONLINE",
|
|
host: "ws-fin-042",
|
|
user: "nora.chen",
|
|
os: "Windows 11 / amd64",
|
|
address: "10.42.8.17",
|
|
seen: "14s ago",
|
|
tags: ["finance", "priority"],
|
|
});
|
|
});
|
|
});
|