From 8109f7850d57d504b02d718c6503a9d0ada70e74 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 19 Nov 2024 13:32:20 -0500 Subject: [PATCH] Add additional test cases to tag model suite. --- client/src/components/Tags/model.test.js | 26 ++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/client/src/components/Tags/model.test.js b/client/src/components/Tags/model.test.js index ce421e7c0c50..c70736920aeb 100644 --- a/client/src/components/Tags/model.test.js +++ b/client/src/components/Tags/model.test.js @@ -64,13 +64,35 @@ describe("Tags/model.js", () => { describe("Tag matching regular expression tests", () => { it("Should allow valid tags", () => { - const validTags = ["tag1", "tag.subtag", "tag.subtag.subtag", "tag.subtag:value", "🌌", "name:🌌", "🌌.🌌"]; + const validTags = [ + "tag1", + "tag.subtag", + "tag.subtag.subtag", + "tag.subtag:value", + "🌌", + "name:🌌", + "🌌.🌌", + "name:value..separated", + ]; for (const tag of validTags) { expect(VALID_TAG_RE.test(tag)).toBeTruthy(); } }); it("Should not allow invalid tags", () => { - const invalidTags = ["", " ", ".", "..", "...", ":", ":value", "tag:", "tag.", ".tag"]; + const invalidTags = [ + "", + " ", + ".", + "..", + "...", + ":", + ":value", + "tag:", + "tag.", + ".tag", + "tag..subtag:value", + "tag:no spaces in value", + ]; for (const tag of invalidTags) { expect(VALID_TAG_RE.test(tag)).toBeFalsy(); }