mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +00:00
Content Audit: Verify upload docs and fix hashtag bug
- Audited `content/docs/guides/upload-content.md` against codebase. - Verified claims regarding file types, size limits, permissions, and CORS. - Fixed a bug in `js/services/videoNotePayload.js` where user-entered hashtags were dropped. - Added regression test `tests/unit/services/videoNotePayload.test.mjs`. - Generated audit artifacts. - Created completion log. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
5e8b6b0141
commit
4312a78159
7 files changed
+109
-1
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { test, describe, it } from "node:test";
|
||||
import assert from "node:assert";
|
||||
import { normalizeVideoNotePayload } from "../../../js/services/videoNotePayload.js";
|
||||
|
||||
describe("normalizeVideoNotePayload", () => {
|
||||
it("should normalize hashtags from 'hashtags' property", () => {
|
||||
const input = {
|
||||
title: "Test Video",
|
||||
url: "https://example.com/video.mp4",
|
||||
nip71: {
|
||||
hashtags: ["one", "two"],
|
||||
},
|
||||
};
|
||||
|
||||
const { payload, errors } = normalizeVideoNotePayload(input);
|
||||
assert.strictEqual(errors.length, 0);
|
||||
assert.deepStrictEqual(payload.nip71.hashtags, ["one", "two"]);
|
||||
});
|
||||
|
||||
it("should normalize hashtags from 't' property (Bug Fix)", () => {
|
||||
const input = {
|
||||
title: "Test Video",
|
||||
url: "https://example.com/video.mp4",
|
||||
nip71: {
|
||||
t: ["one", "two"],
|
||||
},
|
||||
};
|
||||
|
||||
const { payload, errors } = normalizeVideoNotePayload(input);
|
||||
assert.strictEqual(errors.length, 0);
|
||||
|
||||
// This assertion is expected to FAIL before the fix
|
||||
assert.deepStrictEqual(payload.nip71.hashtags, ["one", "two"], "Hashtags should be extracted from 't' property");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user