Skip to content

Commit e5cb632

Browse files
committed
refactor: migrate UITests to RTL
1 parent 4032688 commit e5cb632

File tree

10 files changed

+966
-338
lines changed

10 files changed

+966
-338
lines changed

.mocharc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"require": [
3+
"ts-node/register"
4+
],
5+
"spec": "__tests__/mochatest/**/*.{ts,tsx}",
6+
"timeout": 5000,
7+
"extensions": ["ts", "tsx"],
8+
"reporter": "mocha-junit-reporter",
9+
"reporter-option": [
10+
"mochaFile=./TestResults/MochaReport.xml"
11+
]
12+
}

TestResults/MochaReport.xml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites name="Mocha Tests" time="0.0130" tests="56" failures="0">
3+
<testsuite name="Root Suite" timestamp="2024-10-22T19:37:18" tests="0" time="0.0000" failures="0">
4+
</testsuite>
5+
<testsuite name="isValidIncludeInfo function" timestamp="2024-10-22T19:37:18" tests="5" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0010" failures="0">
6+
<testcase name="isValidIncludeInfo function should return true if includeItemPairs is empty" time="0.0010" classname="should return true if includeItemPairs is empty">
7+
</testcase>
8+
<testcase name="isValidIncludeInfo function should return true if includeItemPairs is valid" time="0.0000" classname="should return true if includeItemPairs is valid">
9+
</testcase>
10+
<testcase name="isValidIncludeInfo function should return false if includes are not unique" time="0.0000" classname="should return false if includes are not unique">
11+
</testcase>
12+
<testcase name="isValidIncludeInfo function should return false if one include is contained in another include" time="0.0000" classname="should return false if one include is contained in another include">
13+
</testcase>
14+
<testcase name="isValidIncludeInfo function should return false if one include with prefix is contained in another include" time="0.0000" classname="should return false if one include with prefix is contained in another include">
15+
</testcase>
16+
</testsuite>
17+
<testsuite name="removeEmptyNodes function" timestamp="2024-10-22T19:37:18" tests="5" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
18+
<testcase name="removeEmptyNodes function should work for empty array" time="0.0000" classname="should work for empty array">
19+
</testcase>
20+
<testcase name="removeEmptyNodes function should remove all items for an array of sections(except Add-ons section) with no childItems" time="0.0000" classname="should remove all items for an array of sections(except Add-ons section) with no childItems">
21+
</testcase>
22+
<testcase name="removeEmptyNodes function should remove all items from an array of sections with childItems but no leaf items" time="0.0000" classname="should remove all items from an array of sections with childItems but no leaf items">
23+
</testcase>
24+
<testcase name="removeEmptyNodes function should remove items with no leaf items" time="0.0000" classname="should remove items with no leaf items">
25+
</testcase>
26+
<testcase name="removeEmptyNodes function should not remove items if all items have leaf items" time="0.0000" classname="should not remove items if all items have leaf items">
27+
</testcase>
28+
</testsuite>
29+
<testsuite name="constructFromIncludeInfo function" timestamp="2024-10-22T19:37:18" tests="8" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0100" failures="0">
30+
<testcase name="constructFromIncludeInfo function should merge all typeListNodes if all of them are matched in include info" time="0.0080" classname="should merge all typeListNodes if all of them are matched in include info">
31+
</testcase>
32+
<testcase name="constructFromIncludeInfo function should skip nodes that are not matched or included" time="0.0000" classname="should skip nodes that are not matched or included">
33+
</testcase>
34+
<testcase name="constructFromIncludeInfo function should merge typeListNodes even if appear in different include info" time="0.0010" classname="should merge typeListNodes even if appear in different include info">
35+
</testcase>
36+
<testcase name="constructFromIncludeInfo function should merge typeListNodes if they are matched or included in include info" time="0.0000" classname="should merge typeListNodes if they are matched or included in include info">
37+
</testcase>
38+
<testcase name="constructFromIncludeInfo function should merge typeListNodes based on the attribute inclusive of include info" time="0.0010" classname="should merge typeListNodes based on the attribute inclusive of include info">
39+
</testcase>
40+
<testcase name="constructFromIncludeInfo function should merge typeListNodes based on include path with prefix" time="0.0000" classname="should merge typeListNodes based on include path with prefix">
41+
</testcase>
42+
<testcase name="constructFromIncludeInfo function should merge typeListNodes even if multiple include paths have the same prefix" time="0.0000" classname="should merge typeListNodes even if multiple include paths have the same prefix">
43+
</testcase>
44+
<testcase name="constructFromIncludeInfo function should merge typeListNodes and build node name from their fullyQualifiedNames after prefix" time="0.0000" classname="should merge typeListNodes and build node name from their fullyQualifiedNames after prefix">
45+
</testcase>
46+
</testsuite>
47+
<testsuite name="updateSections function" timestamp="2024-10-22T19:37:18" tests="8" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0010" failures="0">
48+
<testcase name="updateSections function should throw exceptions 0" time="0.0000" classname="should throw exceptions 0">
49+
</testcase>
50+
<testcase name="updateSections function should throw exceptions 1" time="0.0000" classname="should throw exceptions 1">
51+
</testcase>
52+
<testcase name="updateSections function should throw exceptions 2" time="0.0000" classname="should throw exceptions 2">
53+
</testcase>
54+
<testcase name="updateSections function should throw exceptions 3" time="0.0000" classname="should throw exceptions 3">
55+
</testcase>
56+
<testcase name="updateSections function should throw exceptions 4" time="0.0000" classname="should throw exceptions 4">
57+
</testcase>
58+
<testcase name="updateSections function should insert a new element when there isn&apos;t an existing one" time="0.0010" classname="should insert a new element when there isn&apos;t an existing one">
59+
</testcase>
60+
<testcase name="updateSections function should update existing contents with new contents" time="0.0000" classname="should update existing contents with new contents">
61+
</testcase>
62+
<testcase name="updateSections function should update existing contents including child elements" time="0.0000" classname="should update existing contents including child elements">
63+
</testcase>
64+
</testsuite>
65+
<testsuite name="listNode Class" timestamp="2024-10-22T19:37:18" tests="2" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
66+
<testcase name="listNode Class should create an empty TypeListNode" time="0.0000" classname="should create an empty TypeListNode">
67+
</testcase>
68+
<testcase name="listNode Class should create a TypeListNode with correct attributes" time="0.0000" classname="should create a TypeListNode with correct attributes">
69+
</testcase>
70+
</testsuite>
71+
<testsuite name="LayoutElement class" timestamp="2024-10-22T19:37:18" tests="3" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
72+
<testcase name="LayoutElement class should create an empty LayoutElement" time="0.0000" classname="should create an empty LayoutElement">
73+
</testcase>
74+
<testcase name="LayoutElement class should be able to append a child" time="0.0000" classname="should be able to append a child">
75+
</testcase>
76+
<testcase name="LayoutElement class should create LayoutElement from data with child elements" time="0.0000" classname="should create LayoutElement from data with child elements">
77+
</testcase>
78+
</testsuite>
79+
<testsuite name="ItemData class" timestamp="2024-10-22T19:37:18" tests="3" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
80+
<testcase name="ItemData class should create an LibraryItem from string" time="0.0000" classname="should create an LibraryItem from string">
81+
</testcase>
82+
<testcase name="ItemData class should create an LibraryItem from layoutElement" time="0.0000" classname="should create an LibraryItem from layoutElement">
83+
</testcase>
84+
<testcase name="ItemData class should append some children" time="0.0000" classname="should append some children">
85+
</testcase>
86+
</testsuite>
87+
<testsuite name="buildLibraryItemsFromName function" timestamp="2024-10-22T19:37:18" tests="2" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
88+
<testcase name="buildLibraryItemsFromName function should construct a library item with fullyQualifiedName" time="0.0000" classname="should construct a library item with fullyQualifiedName">
89+
</testcase>
90+
<testcase name="buildLibraryItemsFromName function should construct correctly nested library items with fullyQualifiedName" time="0.0000" classname="should construct correctly nested library items with fullyQualifiedName">
91+
</testcase>
92+
</testsuite>
93+
<testsuite name="setItemStateRecursive function" timestamp="2024-10-22T19:37:18" tests="3" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
94+
<testcase name="setItemStateRecursive function should work on empty array" time="0.0000" classname="should work on empty array">
95+
</testcase>
96+
<testcase name="setItemStateRecursive function should set the correct attributes" time="0.0000" classname="should set the correct attributes">
97+
</testcase>
98+
<testcase name="setItemStateRecursive function should set the correct attributes of child items" time="0.0000" classname="should set the correct attributes of child items">
99+
</testcase>
100+
</testsuite>
101+
<testsuite name="Search function" timestamp="2024-10-22T19:37:18" tests="7" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
102+
<testcase name="Search function should return false when nothing is found" time="0.0000" classname="should return false when nothing is found">
103+
</testcase>
104+
<testcase name="Search function should return true when matched items are found" time="0.0000" classname="should return true when matched items are found">
105+
</testcase>
106+
<testcase name="Search function should show all child items when parent item matches" time="0.0000" classname="should show all child items when parent item matches">
107+
</testcase>
108+
<testcase name="Search function should show parent item when some of its child items are matched" time="0.0000" classname="should show parent item when some of its child items are matched">
109+
</testcase>
110+
<testcase name="Search function should ignore item of type group" time="0.0000" classname="should ignore item of type group">
111+
</testcase>
112+
<testcase name="Search function should return results for search text with regex meta characters" time="0.0000" classname="should return results for search text with regex meta characters">
113+
</testcase>
114+
<testcase name="Search function should highlight text with regex meta characters" time="0.0000" classname="should highlight text with regex meta characters">
115+
</testcase>
116+
</testsuite>
117+
<testsuite name="findAndExpandItemByPath function" timestamp="2024-10-22T19:37:18" tests="2" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0010" failures="0">
118+
<testcase name="findAndExpandItemByPath function should return true if an item is found" time="0.0010" classname="should return true if an item is found">
119+
</testcase>
120+
<testcase name="findAndExpandItemByPath function should return false if an item is not found" time="0.0000" classname="should return false if an item is not found">
121+
</testcase>
122+
</testsuite>
123+
<testsuite name="sortItemsByText function" timestamp="2024-10-22T19:37:18" tests="2" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
124+
<testcase name="sortItemsByText function should sort items in alphabetical order" time="0.0000" classname="should sort items in alphabetical order">
125+
</testcase>
126+
<testcase name="sortItemsByText function should sort items ignoring cases" time="0.0000" classname="should sort items ignoring cases">
127+
</testcase>
128+
</testsuite>
129+
<testsuite name="splitToParts function" timestamp="2024-10-22T19:37:18" tests="6" file="C:\Users\batiste\Workspace\librarie.js\__tests__\mochatest\libraryUtilitiesTest.ts" time="0.0000" failures="0">
130+
<testcase name="splitToParts function should return empty array if text is empty" time="0.0000" classname="should return empty array if text is empty">
131+
</testcase>
132+
<testcase name="splitToParts function should return correct parts if text doesn&apos;t have prefix or delimiter" time="0.0000" classname="should return correct parts if text doesn&apos;t have prefix or delimiter">
133+
</testcase>
134+
<testcase name="splitToParts function should return correct parts if text doesn&apos;t have prefix" time="0.0000" classname="should return correct parts if text doesn&apos;t have prefix">
135+
</testcase>
136+
<testcase name="splitToParts function should return correct parts if text has only prefix" time="0.0000" classname="should return correct parts if text has only prefix">
137+
</testcase>
138+
<testcase name="splitToParts function should return correct parts if text has prefix but no delimiter" time="0.0000" classname="should return correct parts if text has prefix but no delimiter">
139+
</testcase>
140+
<testcase name="splitToParts function should return correct parts if text has prefix and delimiter" time="0.0000" classname="should return correct parts if text has prefix and delimiter">
141+
</testcase>
142+
</testsuite>
143+
</testsuites>

0 commit comments

Comments
 (0)