Ensure comment events keep root e tags alongside addresses

This commit is contained in:
thePR0M3TH3AN committed 2025-11-03 09:56:33 -05:00
1 parent a107f59221
commit d9b45ed867
6 files changed
+71 -10

No files matched your search

+36
View File
@@ -62,6 +62,24 @@ test(
}),
};
assert.ok(
topLevelEvent.tags.some(
(tag) =>
Array.isArray(tag) &&
tag[0] === "e" &&
tag[1] === videoEventId &&
tag[2] === relayUrl,
),
"builder should retain legacy #e tag for the root event when address pointer is present",
);
assert.ok(
topLevelEvent.tags.some(
(tag) =>
Array.isArray(tag) && tag[0] === "a" && tag[1] === videoDefinitionAddress,
),
"builder should include #a pointer for the scoped video definition",
);
const replyEvent = {
id: replyCommentId,
...buildCommentEvent({
@@ -81,6 +99,24 @@ test(
}),
};
assert.ok(
replyEvent.tags.some(
(tag) =>
Array.isArray(tag) &&
tag[0] === "e" &&
tag[1] === videoEventId &&
tag[2] === relayUrl,
),
"reply builder should include root #e tag alongside #a pointer",
);
assert.ok(
replyEvent.tags.some(
(tag) =>
Array.isArray(tag) && tag[0] === "a" && tag[1] === videoDefinitionAddress,
),
"reply builder should preserve #a pointer",
);
const listCalls = [];
const client = {
relays: [relayUrl],