mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
fix(VideoModal): ensure normalized tags retain hash prefix
Fixes a unit test failure in `tests/video-modal-controllers.test.mjs` where tags were expected to be prefixed with `#` but were stripped. Previously, `normalizeVideoTags` explicitly stripped the `#` prefix for deduplication and display. This caused a mismatch with tests that expected the prefix. This change updates `normalizeVideoTags` to preserve or add the `#` prefix, ensuring consistent tag formatting throughout the application and satisfying test expectations. This aligns with `tagPillList.js` logic which also ensures the prefix, providing robustness against component implementation details. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
ef7ae13756
commit
bf96a02fec
1 file changed
+1
-1
@@ -3244,7 +3244,7 @@ export class VideoModal {
|
||||
|
||||
seen.add(key);
|
||||
|
||||
const display = trimmed.startsWith("#") ? trimmed.slice(1) : trimmed;
|
||||
const display = trimmed.startsWith("#") ? trimmed : `#${trimmed}`;
|
||||
normalized.push(display);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user