feat(teams): unify team model, snapshot sharing, and PNG memory parity (#1846)

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Will Pfleger
2026-07-14 17:10:51 -04:00
committed by GitHub
parent 37bc962cb8
commit 448baeef77
89 changed files with 4447 additions and 6144 deletions

View File

@@ -250,3 +250,52 @@ test("resolveSnapshotCard: .agent.json without thumb field yields undefined thum
assert.ok(card !== null);
assert.equal(card.thumb, undefined);
});
// ── team snapshot card ────────────────────────────────────────────────────────
test("resolveSnapshotCard: .team.json with sha256 returns team snapshot card", () => {
const card = resolveSnapshotCard(
{
m: "application/json",
size: 5000,
filename: "my-team.team.json",
x: SHA256,
},
JSON_URL,
"",
);
assert.ok(card !== null);
assert.equal(card.filename, "my-team.team.json");
assert.equal(card.snapshotKind, "team");
assert.equal(card.sha256, SHA256);
});
test("resolveSnapshotCard: .team.png with image/png returns team snapshot card", () => {
const card = resolveSnapshotCard(
{ m: "image/png", size: 3000, filename: "my-team.team.png", x: SHA256 },
PNG_URL,
"",
);
assert.ok(card !== null);
assert.equal(card.snapshotKind, "team");
assert.ok(card.thumb != null, "PNG team card must have a thumb");
});
test("resolveSnapshotCard: plain .team without suffix is not a snapshot", () => {
const card = resolveSnapshotCard(
{ m: "application/json", filename: "team.json", x: SHA256 },
JSON_URL,
"",
);
assert.equal(card, null);
});
test("resolveSnapshotCard: .TEAM.PNG classifies as team snapshot card", () => {
const card = resolveSnapshotCard(
{ m: "image/png", size: 1024, filename: "staff.TEAM.PNG", x: SHA256 },
PNG_URL,
"",
);
assert.ok(card !== null);
assert.equal(card.snapshotKind, "team");
});