Don't add a leading coma when the tag list is empty
This commit is contained in:
Gaetan Craig-Riou
2025-07-16 13:05:20 +10:00
parent 693789d526
commit b2a3715a8b
2 changed files with 17 additions and 2 deletions

View File

@@ -126,6 +126,17 @@ describe("TagListInputController", () => {
expect(variant_add_tag.classList).toContain("tag-error");
});
});
describe("when no tag yet", () => {
it("doesn't include leading comma in hidden tag list input", () => {
variant_tag_list.value = "";
variant_add_tag.value = "latest";
variant_add_tag.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" }));
expect(variant_tag_list.value).toBe("latest");
});
});
});
describe("removeTag", () => {