chore(babysit): cleanup slop
Some checks failed
/ release (push) Has been cancelled
/ build-mobile (push) Has been cancelled
/ build-web (push) Has been cancelled
/ build-desktop (linux) (push) Has been cancelled

This commit is contained in:
Alois 2026-08-07 23:41:49 +02:00
commit 99c38162a6
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
8 changed files with 3065 additions and 6002 deletions

View file

@ -1,45 +0,0 @@
import { describe, expect, it } from "vitest";
import { accountUserSchema, publicUserSchema } from "@tensamin/shared/data";
import { mergeTransientPresence } from "./context";
const profile = {
Display: "Alice",
IotaId: 1,
OmikronConnections: [],
PublicKey: "aGVsbG8=",
SubEnd: 0,
SubLevel: 0,
UserId: 7,
Username: "alice",
};
describe("transient presence overlay", () => {
it("keeps private invisible state on the account without persisting it", () => {
const account = accountUserSchema.parse({
...profile,
OnlineStatus: "user_online",
});
const overlay = new Map([[7, "user_invisible" as const]]);
expect(mergeTransientPresence(account, overlay).OnlineStatus).toBe(
"user_invisible",
);
expect(publicUserSchema.safeParse(account).success).toBe(false);
});
it("merges public live state into a profile without changing durable fields", () => {
const contact = publicUserSchema.parse({
...profile,
OnlineStatus: "user_online",
});
const overlay = new Map([[7, "user_offline" as const]]);
const merged = mergeTransientPresence(contact, overlay);
expect(merged).toMatchObject({
UserId: 7,
Username: "alice",
OnlineStatus: "user_offline",
});
});
});