mirror of
https://github.com/block/buzz.git
synced 2026-11-07 09:52:03 +00:00
Polish agent and team sharing and snapshots (#1852)
This commit is contained in:
@@ -94,6 +94,7 @@ test("resolveSnapshotCard: .agent.json with sha256 returns snapshot card", () =>
|
||||
"",
|
||||
);
|
||||
assert.ok(card !== null, "expected a snapshot card");
|
||||
assert.equal(card.displayName, "Analyst");
|
||||
assert.equal(card.filename, "analyst.agent.json");
|
||||
assert.equal(card.sha256, SHA256);
|
||||
assert.equal(card.snapshotKind, "agent");
|
||||
@@ -107,10 +108,27 @@ test("resolveSnapshotCard: .agent.png with image/png mime returns snapshot card"
|
||||
"",
|
||||
);
|
||||
assert.ok(card !== null);
|
||||
assert.equal(card.displayName, "Analyst");
|
||||
assert.equal(card.filename, "analyst.agent.png");
|
||||
assert.equal(card.snapshotKind, "agent");
|
||||
});
|
||||
|
||||
test("resolveSnapshotCard: sender label is used as the agent name", () => {
|
||||
const card = resolveSnapshotCard(
|
||||
{
|
||||
m: "image/png",
|
||||
size: 2048,
|
||||
filename: "animation-auditor.agent.png",
|
||||
x: SHA256,
|
||||
},
|
||||
PNG_URL,
|
||||
"Animation Auditor",
|
||||
);
|
||||
assert.ok(card !== null);
|
||||
assert.equal(card.displayName, "Animation Auditor");
|
||||
assert.equal(card.filename, "animation-auditor.agent.png");
|
||||
});
|
||||
|
||||
test("resolveSnapshotCard: .agent.json with octet-stream mime is eligible", () => {
|
||||
// JSON snapshots often arrive as application/octet-stream.
|
||||
const card = resolveSnapshotCard(
|
||||
@@ -283,7 +301,7 @@ test("resolveSnapshotCard: .team.png with image/png returns team snapshot card",
|
||||
);
|
||||
assert.ok(card !== null);
|
||||
assert.equal(card.snapshotKind, "team");
|
||||
assert.ok(card.thumb != null, "PNG team card must have a thumb");
|
||||
assert.equal(card.thumb, undefined);
|
||||
});
|
||||
|
||||
test("resolveSnapshotCard: plain .team without suffix is not a snapshot", () => {
|
||||
|
||||
Reference in New Issue
Block a user