testeranto 0.166.0 → 0.171.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/common/src/NavBar.js +45 -0
  2. package/dist/common/src/PM/main.js +81 -59
  3. package/dist/common/src/Pure.js +17 -15
  4. package/dist/common/src/ReportServer.js +48 -5
  5. package/dist/common/src/Web.js +35 -20
  6. package/dist/common/src/components/SunriseAnimation.test/implementation.js +1 -0
  7. package/dist/common/src/components/SunriseAnimation.test/index.js +1 -0
  8. package/dist/common/src/components/SunriseAnimation.test/interface.js +1 -0
  9. package/dist/common/src/components/SunriseAnimation.test/specification.js +1 -0
  10. package/dist/common/src/components/TestStatusBadge.js +55 -0
  11. package/dist/common/src/components/pure/ProjectPageView.js +204 -0
  12. package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +20 -0
  13. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +71 -0
  14. package/dist/common/src/components/pure/ProjectPageView.test/index.js +10 -0
  15. package/dist/common/src/components/pure/ProjectPageView.test/specification.js +19 -0
  16. package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
  17. package/dist/common/src/lib/BaseSuite.js +3 -3
  18. package/dist/common/src/lib/BaseSuite.test/test.js +1 -1
  19. package/dist/common/src/lib/abstractBase.js +41 -14
  20. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  21. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  22. package/dist/common/src/lib/basebuilder.js +9 -7
  23. package/dist/common/src/lib/core.test/MockCore.js +17 -15
  24. package/dist/common/src/lib/pmProxy.js +185 -64
  25. package/dist/common/testeranto.config.js +6 -0
  26. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  27. package/dist/module/src/App.js +3 -3
  28. package/dist/module/src/PM/main.js +81 -59
  29. package/dist/module/src/ProjectsPage.js +1 -110
  30. package/dist/module/src/Pure.js +17 -15
  31. package/dist/module/src/ReportServer.js +48 -5
  32. package/dist/module/src/TestPage.js +45 -16
  33. package/dist/module/src/Web.js +35 -20
  34. package/dist/module/src/components/SunriseAnimation.test/implementation.js +1 -0
  35. package/dist/module/src/components/SunriseAnimation.test/index.js +1 -0
  36. package/dist/module/src/components/SunriseAnimation.test/interface.js +1 -0
  37. package/dist/module/src/components/SunriseAnimation.test/specification.js +1 -0
  38. package/dist/module/src/components/pure/ProjectPageView.js +197 -0
  39. package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +17 -0
  40. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +68 -0
  41. package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -0
  42. package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -0
  43. package/dist/module/src/components/pure/ProjectPageView.test/types.js +1 -0
  44. package/dist/module/src/components/pure/ProjectsPageView.js +58 -0
  45. package/dist/module/src/components/pure/TestPageView.js +136 -0
  46. package/dist/module/src/components/stateful/ProjectPage.js +63 -0
  47. package/dist/module/src/components/stateful/ProjectsPage.js +55 -0
  48. package/dist/module/src/components/stateful/TestPage.js +82 -0
  49. package/dist/module/src/lib/BaseSuite.js +3 -3
  50. package/dist/module/src/lib/BaseSuite.test/test.js +1 -1
  51. package/dist/module/src/lib/abstractBase.js +41 -14
  52. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  53. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  54. package/dist/module/src/lib/basebuilder.js +9 -7
  55. package/dist/module/src/lib/core.test/MockCore.js +17 -15
  56. package/dist/module/src/lib/pmProxy.js +185 -64
  57. package/dist/module/testeranto.config.js +6 -0
  58. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  59. package/dist/prebuild/App.js +541 -495
  60. package/dist/prebuild/ReportServer.mjs +44 -4
  61. package/dist/prebuild/run.mjs +67 -39
  62. package/dist/types/src/NavBar.d.ts +19 -0
  63. package/dist/types/src/PM/index.d.ts +3 -1
  64. package/dist/types/src/PM/main.d.ts +0 -4
  65. package/dist/types/src/PM/node.d.ts +2 -2
  66. package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +0 -0
  67. package/dist/types/src/components/SunriseAnimation.test/specification.d.ts +0 -0
  68. package/dist/types/src/components/TestStatusBadge.d.ts +15 -0
  69. package/dist/types/src/components/pure/ProjectPageView.d.ts +14 -0
  70. package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +3 -0
  71. package/dist/types/src/components/pure/ProjectPageView.test/implementation.d.ts +3 -0
  72. package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +3 -0
  73. package/dist/types/src/components/pure/ProjectPageView.test/specification.d.ts +3 -0
  74. package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +39 -0
  75. package/dist/types/src/lib/BaseSuite.d.ts +2 -0
  76. package/dist/types/src/lib/abstractBase.d.ts +12 -0
  77. package/dist/types/src/lib/index.d.ts +0 -1
  78. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  79. package/package.json +3 -2
  80. package/src/App.tsx +5 -9
  81. package/src/PM/index.ts +1 -1
  82. package/src/PM/main.ts +87 -82
  83. package/src/PM/node.ts +2 -2
  84. package/src/ProjectsPage.tsx +1 -164
  85. package/src/Pure.ts +17 -17
  86. package/src/ReportServer.ts +49 -6
  87. package/src/TestPage.tsx +78 -5
  88. package/src/Web.ts +35 -35
  89. package/src/components/SunriseAnimation.test/implementation.ts +0 -0
  90. package/src/components/SunriseAnimation.test/index.ts +0 -0
  91. package/src/components/SunriseAnimation.test/interface.ts +0 -0
  92. package/src/components/SunriseAnimation.test/specification.ts +0 -0
  93. package/src/components/pure/ProjectPageView.test/adapter.ts +21 -0
  94. package/src/components/pure/ProjectPageView.test/implementation.tsx +84 -0
  95. package/src/components/pure/ProjectPageView.test/index.ts +8 -0
  96. package/src/components/pure/ProjectPageView.test/specification.ts +31 -0
  97. package/src/components/pure/ProjectPageView.test/types.ts +55 -0
  98. package/src/components/pure/ProjectPageView.tsx +332 -0
  99. package/src/components/pure/ProjectsPageView.tsx +99 -0
  100. package/src/components/pure/TestPageView.tsx +278 -0
  101. package/src/components/stateful/ProjectPage.tsx +83 -0
  102. package/src/components/stateful/ProjectsPage.tsx +73 -0
  103. package/src/components/stateful/TestPage.tsx +107 -0
  104. package/src/lib/BaseSuite.test/test.ts +1 -1
  105. package/src/lib/BaseSuite.ts +9 -4
  106. package/src/lib/abstractBase.ts +45 -14
  107. package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +1 -1
  108. package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +1 -1
  109. package/src/lib/basebuilder.ts +9 -9
  110. package/src/lib/core.test/MockCore.ts +26 -19
  111. package/src/lib/index.ts +1 -1
  112. package/src/lib/pmProxy.ts +184 -87
  113. package/testeranto/App.js +541 -495
  114. package/testeranto/bundles/node/allTests/{chunk-4ONUZRZ4.mjs → chunk-3EUGBAOM.mjs} +1 -1
  115. package/testeranto/bundles/node/allTests/{chunk-FFBRDUBH.mjs → chunk-E75CSRER.mjs} +247 -124
  116. package/testeranto/bundles/node/allTests/{chunk-NQEP7SN4.mjs → chunk-M6DO7VMB.mjs} +1 -1
  117. package/testeranto/bundles/node/allTests/metafile.json +41 -41
  118. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +4 -4
  119. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +4 -4
  120. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +3 -3
  121. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +11 -23
  122. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +2 -2
  123. package/testeranto/bundles/pure/allTests/{chunk-CSMXYJ65.mjs → chunk-KHDVEHF7.mjs} +3 -18
  124. package/testeranto/bundles/pure/allTests/{chunk-QK4IXLF6.mjs → chunk-VMUSFSZM.mjs} +247 -124
  125. package/testeranto/bundles/pure/allTests/metafile.json +77 -47
  126. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +2 -2
  127. package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +3 -3
  128. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +3 -30
  129. package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +2283 -0
  130. package/testeranto/bundles/web/allTests/{chunk-TU3MJSSI.mjs → chunk-RLDR6LJN.mjs} +302 -127
  131. package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +997 -0
  132. package/testeranto/bundles/web/allTests/metafile.json +15065 -46
  133. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.html +19 -0
  134. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.mjs +37524 -0
  135. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +20 -2
  136. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +27 -3
  137. package/testeranto/reports/allTests/config.json +8 -0
  138. package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +9 -3
  139. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +1 -0
  140. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +13 -0
  141. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +50 -0
  142. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
  143. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +17 -0
  144. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +32 -0
  145. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +68 -0
  146. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -0
  147. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +6 -3
  148. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +8 -1
  149. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +6 -3
  150. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +9 -3
  151. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -0
  152. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +2 -2
  153. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +6 -3
  154. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +10 -5
  155. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -0
  156. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +18 -9
  157. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +8 -1
  158. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +10 -5
  159. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
  160. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +2 -2
  161. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +18 -9
  162. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +10 -5
  163. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -0
  164. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +36 -18
  165. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +8 -1
  166. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -12
  167. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +2 -2
  168. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +11 -8
  169. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -0
  170. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +28 -14
  171. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +8 -1
  172. package/testeranto/reports/allTests/summary.json +16 -9
  173. package/testeranto/reportsweb_build_errors +25 -0
  174. package/testeranto.config.ts +7 -0
  175. package/tsc.log +313 -237
  176. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test/manifest.json +0 -1
  177. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/manifest.json +0 -1
  178. package/testeranto/reports/allTests/src/Pure.test/pure/manifest.json +0 -1
  179. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/manifest.json +0 -1
  180. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/manifest.json +0 -1
  181. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/manifest.json +0 -1
  182. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/manifest.json +0 -1
  183. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/manifest.json +0 -1
  184. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/manifest.json +0 -1
  185. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/manifest.json +0 -1
  186. /package/{testeranto/reports/allTests/src/Pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/implementation.d.ts} +0 -0
  187. /package/{testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/index.d.ts} +0 -0
package/src/TestPage.tsx CHANGED
@@ -253,19 +253,92 @@ export const TestPage = () => {
253
253
  {testData.givens.map((given, i) => (
254
254
  <div key={i} className="mb-4 card">
255
255
  <div className="card-header bg-primary text-white">
256
- <h4>Given: {given.name}</h4>
256
+ <div className="d-flex justify-content-between align-items-center">
257
+ <h4>Given: {given.name}</h4>
258
+ {given.artifacts?.length > 0 && (
259
+ <div className="dropdown">
260
+ <button
261
+ className="btn btn-sm btn-light dropdown-toggle"
262
+ type="button"
263
+ data-bs-toggle="dropdown"
264
+ >
265
+ Artifacts ({given.artifacts.length})
266
+ </button>
267
+ <ul className="dropdown-menu dropdown-menu-end">
268
+ {given.artifacts.map((artifact, ai) => (
269
+ <li key={ai}>
270
+ <a
271
+ className="dropdown-item"
272
+ href={`/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`}
273
+ target="_blank"
274
+ rel="noopener noreferrer"
275
+ >
276
+ {artifact.split('/').pop()}
277
+ </a>
278
+ </li>
279
+ ))}
280
+ </ul>
281
+ </div>
282
+ )}
283
+ </div>
257
284
  </div>
258
285
  <div className="card-body">
259
286
  {given.whens.map((when, j) => (
260
287
  <div key={`w-${j}`} className={`p-3 mb-2 ${when.error ? 'bg-danger text-white' : 'bg-success text-white'}`}>
261
- <strong>When:</strong> {when.name}
262
- {when.error && <pre className="mt-2">{when.error}</pre>}
288
+ <div className="d-flex justify-content-between align-items-start">
289
+ <div>
290
+ <strong>When:</strong> {when.name}
291
+ {when.error && <pre className="mt-2">{when.error}</pre>}
292
+ </div>
293
+ {when.artifacts?.length > 0 && (
294
+ <div className="ms-3">
295
+ <strong>Artifacts:</strong>
296
+ <ul className="list-unstyled">
297
+ {when.artifacts.map((artifact, ai) => (
298
+ <li key={ai}>
299
+ <a
300
+ href={`/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`}
301
+ target="_blank"
302
+ className="text-white"
303
+ rel="noopener noreferrer"
304
+ >
305
+ {artifact.split('/').pop()}
306
+ </a>
307
+ </li>
308
+ ))}
309
+ </ul>
310
+ </div>
311
+ )}
312
+ </div>
263
313
  </div>
264
314
  ))}
265
315
  {given.thens.map((then, k) => (
266
316
  <div key={`t-${k}`} className={`p-3 mb-2 ${then.error ? 'bg-danger text-white' : 'bg-success text-white'}`}>
267
- <strong>Then:</strong> {then.name}
268
- {then.error && <pre className="mt-2">{then.error}</pre>}
317
+ <div className="d-flex justify-content-between align-items-start">
318
+ <div>
319
+ <strong>Then:</strong> {then.name}
320
+ {then.error && <pre className="mt-2">{then.error}</pre>}
321
+ </div>
322
+ {then.artifacts?.length > 0 && (
323
+ <div className="ms-3">
324
+ <strong>Artifacts:</strong>
325
+ <ul className="list-unstyled">
326
+ {then.artifacts.map((artifact, ai) => (
327
+ <li key={ai}>
328
+ <a
329
+ href={`/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`}
330
+ target="_blank"
331
+ className="text-white"
332
+ rel="noopener noreferrer"
333
+ >
334
+ {artifact.split('/').pop()}
335
+ </a>
336
+ </li>
337
+ ))}
338
+ </ul>
339
+ </div>
340
+ )}
341
+ </div>
269
342
  </div>
270
343
  ))}
271
344
  </div>
package/src/Web.ts CHANGED
@@ -17,10 +17,13 @@ import {
17
17
  defaultTestResourceRequirement,
18
18
  } from "./lib/index.js";
19
19
 
20
- let errorCallback = (e: any) => {};
21
- let unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
22
- console.log("window.addEventListener unhandledrejection", event);
23
- };
20
+ // let errorCallback = (e: any) => {};
21
+ // let unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
22
+ // console.log(
23
+ // "window.addEventListener unhandledrejection 1",
24
+ // JSON.stringify(event)
25
+ // );
26
+ // };
24
27
 
25
28
  export class WebTesteranto<
26
29
  I extends Ibdd_in_any,
@@ -41,37 +44,34 @@ export class WebTesteranto<
41
44
  testResourceRequirement,
42
45
  testAdapter,
43
46
  (cb) => {
44
- window.removeEventListener("error", errorCallback);
45
-
46
- errorCallback = (e) => {
47
- console.log("window.addEventListener error", e);
48
- cb(e);
49
- // throw e;
50
- };
51
-
52
- window.addEventListener("error", errorCallback);
53
-
54
- window.removeEventListener(
55
- "unhandledrejection",
56
- unhandledrejectionCallback
57
- );
58
- /////////////////////
59
-
60
- window.removeEventListener(
61
- "unhandledrejection",
62
- unhandledrejectionCallback
63
- );
64
-
65
- unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
66
- console.log("window.addEventListener unhandledrejection", event);
67
- cb({ error: event.reason.message });
68
- // throw event;
69
- };
70
-
71
- window.addEventListener(
72
- "unhandledrejection",
73
- unhandledrejectionCallback
74
- );
47
+ // window.removeEventListener("error", errorCallback);
48
+ // errorCallback = (e) => {
49
+ // console.log("window.addEventListener error 2", JSON.stringify(e));
50
+ // cb(e);
51
+ // // throw e;
52
+ // };
53
+ // window.addEventListener("error", errorCallback);
54
+ // window.removeEventListener(
55
+ // "unhandledrejection",
56
+ // unhandledrejectionCallback
57
+ // );
58
+ // /////////////////////
59
+ // window.removeEventListener(
60
+ // "unhandledrejection",
61
+ // unhandledrejectionCallback
62
+ // );
63
+ // unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
64
+ // console.log(
65
+ // "window.addEventListener unhandledrejection 3",
66
+ // JSON.stringify(event)
67
+ // );
68
+ // cb({ error: event.reason.message });
69
+ // // throw event;
70
+ // };
71
+ // window.addEventListener(
72
+ // "unhandledrejection",
73
+ // unhandledrejectionCallback
74
+ // );
75
75
  }
76
76
  );
77
77
  }
File without changes
@@ -0,0 +1,21 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import { ITestAdapter } from "../../../CoreTypes";
3
+ import { I } from "./types";
4
+
5
+ export const adapter: ITestAdapter<I> = {
6
+ beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
7
+ return initializer();
8
+ },
9
+ andWhen: async (store, whenCB, testResource, pm) => {
10
+ return whenCB(store, pm);
11
+ },
12
+ butThen: async (store, thenCB, testResource, pm) => {
13
+ return thenCB(store, pm);
14
+ },
15
+ afterEach: async (store, key, pm) => {
16
+ if (store?.container) {
17
+ store.container.remove();
18
+ }
19
+ return store;
20
+ },
21
+ };
@@ -0,0 +1,84 @@
1
+ import { assert, expect } from "chai";
2
+ import { ITestImplementation } from "../../../CoreTypes";
3
+ import { I, M, O } from "./types";
4
+
5
+ export const implementation: ITestImplementation<I, O, M> = {
6
+ suites: {
7
+ Default: "Project Page View Tests",
8
+ },
9
+
10
+ givens: {
11
+ Default: () => ({
12
+ summary: {},
13
+ nodeLogs: null,
14
+ webLogs: null,
15
+ pureLogs: null,
16
+ config: { tests: [] },
17
+ loading: false,
18
+ error: null,
19
+ projectName: "test-project",
20
+ route: "tests",
21
+ setRoute: () => { },
22
+ navigate: () => { },
23
+ }),
24
+ WithError: () => ({
25
+ summary: null,
26
+ nodeLogs: null,
27
+ webLogs: null,
28
+ pureLogs: null,
29
+ config: { tests: [] },
30
+ loading: false,
31
+ error: "Test error message",
32
+ projectName: "test-project",
33
+ route: "tests",
34
+ setRoute: () => { },
35
+ navigate: () => { },
36
+ }),
37
+ },
38
+ whens: {
39
+
40
+ },
41
+
42
+ thens: {
43
+ happyPath:
44
+ () =>
45
+ async ({ container, html }, pm) => {
46
+ console.group('[Test] Verifying render output');
47
+ debugger
48
+ const p = await pm.page();
49
+ await pm.customScreenShot({ path: "happyPath.png" }, p);
50
+
51
+ assert.equal(1, 1);
52
+ // try {
53
+ // console.log('Checking for container-fluid');
54
+ // const containerFluid = container.querySelector(".container-fluid");
55
+ // expect(containerFluid).to.exist;
56
+ // expect(containerFluid?.children.length).to.be.greaterThan(0);
57
+
58
+ // console.log('Checking for NavBar');
59
+ // const navBar = container.querySelector("nav.navbar");
60
+ // expect(navBar).to.exist;
61
+
62
+ // console.log('Render verification passed');
63
+ // console.groupEnd();
64
+ // return { container, html };
65
+ // } catch (err) {
66
+ // console.error('Verification failed:', err);
67
+ // console.error('Full HTML:', html);
68
+ // console.groupEnd();
69
+ // throw err;
70
+ // }
71
+ },
72
+ unhappyPath:
73
+ () =>
74
+ async ({ container }, pm) => {
75
+ // expect(container.textContent).contain("Test error message");
76
+ assert.equal(1, 1);
77
+
78
+ const p = await pm.page();
79
+ await pm.customScreenShot({ path: "unhappyPath.png" }, p);
80
+
81
+ return { container };
82
+ },
83
+ },
84
+ };
@@ -0,0 +1,8 @@
1
+ import Testeranto from "testeranto-react/src/react-dom/component/web";
2
+
3
+ import { implementation } from "./implementation";
4
+ import { specification } from "./specification";
5
+ import { I, O } from "./types";
6
+ import { ProjectPageView } from "../ProjectPageView";
7
+
8
+ export default Testeranto<I, O>(implementation, specification, ProjectPageView);
@@ -0,0 +1,31 @@
1
+ import { ITestSpecification } from "../../../CoreTypes";
2
+ import { I, O } from "./types";
3
+
4
+ export const specification: ITestSpecification<I, O> = (
5
+ Suite,
6
+ Given,
7
+ When,
8
+ Then
9
+ ) => {
10
+ return [
11
+ Suite.Default("ProjectPageView Component Tests", {
12
+ basicRender: Given.Default(
13
+ [
14
+ "ProjectPageView should render",
15
+ "It should contain a container-fluid div",
16
+ "It should render the NavBar component",
17
+ ],
18
+ [],
19
+ [Then.happyPath()]
20
+ ),
21
+ errorHandling: Given.WithError(
22
+ [
23
+ "ProjectPageView should handle errors",
24
+ "It should display error messages when present",
25
+ ],
26
+ [],
27
+ [Then.unhappyPath()]
28
+ ),
29
+ }),
30
+ ];
31
+ };
@@ -0,0 +1,55 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { Ibdd_in, Ibdd_out } from "../../../CoreTypes";
4
+ import { IProjectPageViewProps } from "../ProjectPageView";
5
+
6
+ export type I = Ibdd_in<
7
+ null,
8
+ IProjectPageViewProps,
9
+ IProjectPageViewProps & { container?: HTMLElement },
10
+ IProjectPageViewProps & { container?: HTMLElement },
11
+ (...args: any[]) => IProjectPageViewProps,
12
+ () => (
13
+ props: IProjectPageViewProps,
14
+ utils: any
15
+ ) => IProjectPageViewProps & { container?: HTMLElement },
16
+ () => (
17
+ state: IProjectPageViewProps & { container?: HTMLElement }
18
+ ) => IProjectPageViewProps & { container?: HTMLElement }
19
+ >;
20
+
21
+ export type O = Ibdd_out<
22
+ {
23
+ Default: [string];
24
+ },
25
+ {
26
+ Default: [];
27
+ WithError: [];
28
+ },
29
+ {},
30
+ {
31
+ happyPath: [];
32
+ unhappyPath: [];
33
+ }
34
+ >;
35
+
36
+ export type M = {
37
+ givens: {
38
+ [K in keyof O["givens"]]: (...args: any[]) => IProjectPageViewProps;
39
+ };
40
+ whens: {
41
+ [K in keyof O["whens"]]: (
42
+ ...args: any[]
43
+ ) => (
44
+ props: IProjectPageViewProps,
45
+ utils: any
46
+ ) => IProjectPageViewProps & { container?: HTMLElement };
47
+ };
48
+ thens: {
49
+ [K in keyof O["thens"]]: (
50
+ ...args: any[]
51
+ ) => (
52
+ state: IProjectPageViewProps & { container?: HTMLElement }
53
+ ) => IProjectPageViewProps & { container?: HTMLElement };
54
+ };
55
+ };