16 lines
874 B
TypeScript
16 lines
874 B
TypeScript
import assert from "node:assert/strict";
|
|
import { test } from "node:test";
|
|
import { postAuthorLabel } from "../lib/display";
|
|
|
|
test("formats Memos authors as name at source hostname", () => {
|
|
assert.equal(postAuthorLabel({ origin: "memos", username: "hub-user", name: "codex", remote_display_name: "codex", source_base_url: "https://memos.fishking.studio/path" }), "@codex@memos.fishking.studio");
|
|
});
|
|
|
|
test("formats Hub posts linked to Memos with the same source identity", () => {
|
|
assert.equal(postAuthorLabel({ origin: "hub", username: "codex", name: "codex", remote_display_name: "codex", source_base_url: "https://memos.fishking.studio" }), "@codex@memos.fishking.studio");
|
|
});
|
|
|
|
test("keeps the existing label for non-Memos posts", () => {
|
|
assert.equal(postAuthorLabel({ origin: "hub", username: "codex", name: "Hub", source_base_url: null }), "@Hub · Hub");
|
|
});
|