mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 05:43:04 +00:00
test: update VideoModal tag expectations to include hash prefix
VideoModal now normalizes tags by prepending a `#` character if missing. This commit updates `tests/video-modal-controllers.test.mjs` to expect tags with the `#` prefix in assertions and the mock `TagPreferenceStateResolver`. Fixes: `VideoModal trims tag strip to fit modal width` assertion failure. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
870f8ee8c8
commit
6d348e610d
1 file changed
+4
-4
@@ -85,10 +85,10 @@ test("VideoModal trims tag strip to fit modal width", async (t) => {
|
||||
assert.ok(root, "tag container should be available after hydrate");
|
||||
|
||||
modal.setTagPreferenceStateResolver((tag) => {
|
||||
if (tag === "alpha") {
|
||||
if (tag === "#alpha") {
|
||||
return "interest";
|
||||
}
|
||||
if (tag === "beta") {
|
||||
if (tag === "#beta") {
|
||||
return "disinterest";
|
||||
}
|
||||
return "neutral";
|
||||
@@ -143,7 +143,7 @@ test("VideoModal trims tag strip to fit modal width", async (t) => {
|
||||
assert.equal(trimmedButtons.length, 2, "tag list should be trimmed to fit");
|
||||
assert.deepEqual(
|
||||
trimmedButtons.map((button) => button.dataset.tag),
|
||||
["alpha", "beta"],
|
||||
["#alpha", "#beta"],
|
||||
"leading tags should remain after trimming",
|
||||
);
|
||||
assert.equal(
|
||||
@@ -185,7 +185,7 @@ test("VideoModal trims tag strip to fit modal width", async (t) => {
|
||||
);
|
||||
assert.deepEqual(
|
||||
expandedButtons.map((button) => button.dataset.tag),
|
||||
["alpha", "beta", "delta"],
|
||||
["#alpha", "#beta", "#delta"],
|
||||
"reflow should restore full list order before trimming",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user