mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +00:00
Ensure comment events keep root e tags alongside addresses
This commit is contained in:
1 parent
a107f59221
commit
d9b45ed867
6 files changed
+71
-10
No files matched your search
@@ -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],
|
||||
|
||||
Reference in new issue
Block a user