Skip to content

Commit eee7255

Browse files
author
Wanasit Tanakitrungruang
committed
Refactor: Add more tests for tagging feature
1 parent 77a8bc5 commit eee7255

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/result.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ test("Test - Create & manipulate parsing results", () => {
8787
expect(result.toString()).toContain(text);
8888
expect(result.toString()).toContain("custom/testing_start_component_tag");
8989
expect(result.toString()).toContain("custom/testing_end_component_tag");
90+
91+
// The result's addTag() and addTags() should add the tags to both start/end components
92+
result.addTag("custom/testing_result_tag1");
93+
result.addTags(["custom/testing_result_tag2"]);
94+
expect(startComponents.tags()).toContain("custom/testing_result_tag1");
95+
expect(startComponents.tags()).toContain("custom/testing_result_tag2");
96+
expect(endComponents.tags()).toContain("custom/testing_result_tag1");
97+
expect(endComponents.tags()).toContain("custom/testing_result_tag2");
9098
});
9199

92100
test("Test - Calendar checking with implied components", () => {

0 commit comments

Comments
 (0)