@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.28.8 → 4.29.1

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 (197) hide show
  1. package/dpr/all.js +6 -8
  2. package/dpr/all.js.map +3 -3
  3. package/dpr/all.scss +296 -414
  4. package/dpr/all.ts +6 -11
  5. package/dpr/components/_catalogue/catalogue-list/utils.test.ts +1 -1
  6. package/dpr/components/_charts/chart/ChartTimeseries.js +3 -2
  7. package/dpr/components/_charts/chart/ChartTimeseries.js.map +2 -2
  8. package/dpr/components/_charts/chart/ChartTimeseries.ts +4 -2
  9. package/dpr/components/_charts/chart/clientClass.js +1 -0
  10. package/dpr/components/_charts/chart/clientClass.js.map +2 -2
  11. package/dpr/components/_charts/chart/clientClass.ts +1 -0
  12. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js.map +1 -1
  13. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.js +1 -1
  14. package/dpr/components/_reports/report-heading/report-actions/clientClass.js.map +7 -0
  15. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/clientClass.ts +1 -1
  16. package/dpr/components/_reports/report-heading/report-actions/types.d.js.map +7 -0
  17. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.ts +1 -1
  18. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js.map +1 -1
  19. package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.test.ts +2 -2
  20. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.js +1 -3
  21. package/dpr/components/_reports/report-heading/report-columns/report-columns-form/clientClass.js.map +7 -0
  22. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/clientClass.ts +1 -3
  23. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js.map +1 -1
  24. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.js +1 -1
  25. package/dpr/components/_reports/report-heading/report-columns/report-columns-form/utils.js.map +7 -0
  26. package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/utils.ts +2 -2
  27. package/dpr/components/_reports/{report-columns → report-heading/report-columns}/view.njk +1 -1
  28. package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.js +1 -1
  29. package/dpr/components/_reports/report-heading/report-download-message/clientClass.js.map +7 -0
  30. package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/clientClass.ts +1 -1
  31. package/dpr/components/_reports/{report-filters → report-heading/report-filters}/view.njk +1 -1
  32. package/dpr/components/_reports/report-heading/view.njk +4 -4
  33. package/dpr/components/_reports/report-page/report-print-message/view.njk +10 -0
  34. package/dpr/components/_reports/report-page/report-template/report-no-data-message/styles.scss +8 -0
  35. package/dpr/components/_reports/report-page/report-template/report-no-data-message/view.njk +11 -0
  36. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.js +1 -1
  37. package/dpr/components/_reports/report-page/report-template/report-pagination/clientClass.js.map +7 -0
  38. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/clientClass.ts +1 -1
  39. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.js.map +1 -1
  40. package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js.map +1 -1
  41. package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/styles.scss +88 -0
  42. package/dpr/components/_reports/report-page/report-template/report-section/parent-child-template/view.njk +29 -0
  43. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.js +17 -10
  44. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/clientClass.js.map +7 -0
  45. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/clientClass.ts +20 -10
  46. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/style.scss +35 -185
  47. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/types.d.js.map +7 -0
  48. package/dpr/components/_reports/{report-data-table → report-page/report-template/report-section/report-data-table}/types.d.ts +2 -2
  49. package/dpr/components/_reports/report-page/report-template/report-section/report-data-table/view.njk +27 -0
  50. package/dpr/components/_reports/report-page/report-template/report-section/styles.scss +33 -0
  51. package/dpr/components/_reports/report-page/report-template/report-section/view.njk +58 -0
  52. package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/styles.scss +21 -4
  53. package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js.map +1 -1
  54. package/dpr/components/_reports/report-page/report-template/styles.scss +5 -0
  55. package/dpr/components/_reports/report-page/report-template/template-config.js +66 -0
  56. package/dpr/components/_reports/report-page/report-template/template-config.js.map +7 -0
  57. package/dpr/components/_reports/report-page/report-template/template-config.ts +45 -0
  58. package/dpr/components/_reports/report-page/report-template/utils.js +82 -0
  59. package/dpr/components/_reports/report-page/report-template/utils.js.map +7 -0
  60. package/dpr/components/_reports/report-page/report-template/utils.ts +100 -0
  61. package/dpr/components/_reports/report-page/report-template/view.njk +61 -0
  62. package/dpr/components/_reports/{report-wrapper → report-page}/styles.scss +7 -5
  63. package/dpr/components/_reports/report-page/view.njk +26 -0
  64. package/dpr/components/card-group/view.njk +0 -4
  65. package/dpr/components/report-list/utils.js +11 -3
  66. package/dpr/components/report-list/utils.js.map +2 -2
  67. package/dpr/components/report-list/utils.ts +11 -1
  68. package/dpr/components/report-list/view.njk +2 -2
  69. package/dpr/components/show-more/style.scss +3 -4
  70. package/dpr/data/reportingClient.js.map +2 -2
  71. package/dpr/data/reportingClient.ts +4 -4
  72. package/dpr/routes/journeys/view-report/async/dashboard/utils.js +1 -1
  73. package/dpr/routes/journeys/view-report/async/dashboard/utils.js.map +1 -1
  74. package/dpr/routes/journeys/view-report/async/dashboard/utils.ts +1 -1
  75. package/dpr/routes/journeys/view-report/async/report/controller.js.map +2 -2
  76. package/dpr/routes/journeys/view-report/async/report/controller.ts +0 -1
  77. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js +207 -56
  78. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.js.map +2 -2
  79. package/dpr/routes/journeys/view-report/async/report/report-variants.cy.ts +333 -64
  80. package/dpr/routes/journeys/view-report/async/report/utils.js +9 -17
  81. package/dpr/routes/journeys/view-report/async/report/utils.js.map +3 -3
  82. package/dpr/routes/journeys/view-report/async/report/utils.ts +12 -22
  83. package/dpr/routes/journeys/view-report/report.njk +2 -2
  84. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js +1 -1
  85. package/dpr/routes/journeys/view-report/sync/dashboard/utils.js.map +1 -1
  86. package/dpr/routes/journeys/view-report/sync/dashboard/utils.ts +1 -1
  87. package/dpr/routes/journeys/view-report/sync/report/utils.js +38 -11
  88. package/dpr/routes/journeys/view-report/sync/report/utils.js.map +3 -3
  89. package/dpr/routes/journeys/view-report/sync/report/utils.ts +39 -14
  90. package/dpr/routes/journeys/view-report/utils.js +1 -1
  91. package/dpr/routes/journeys/view-report/utils.js.map +1 -1
  92. package/dpr/routes/journeys/view-report/utils.ts +1 -1
  93. package/dpr/services/reportingService.js.map +2 -2
  94. package/dpr/services/reportingService.ts +2 -2
  95. package/dpr/types/ReportQuery.js +1 -1
  96. package/dpr/types/ReportQuery.js.map +1 -1
  97. package/dpr/types/ReportQuery.ts +1 -1
  98. package/dpr/types/UserReports.js.map +1 -1
  99. package/dpr/types/UserReports.ts +3 -3
  100. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js +193 -0
  101. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.js.map +7 -0
  102. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/ParentChildDataBuilder.ts +203 -0
  103. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.js.map +7 -0
  104. package/dpr/utils/TemplateBuilder/ParentChildDataBuilder/types.d.ts +36 -0
  105. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js +114 -0
  106. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.js.map +7 -0
  107. package/dpr/utils/TemplateBuilder/ReportBuilder/ReportBuilder.ts +117 -0
  108. package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.js.map +7 -0
  109. package/dpr/utils/TemplateBuilder/ReportBuilder/types.d.ts +6 -0
  110. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js +202 -0
  111. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.js.map +7 -0
  112. package/dpr/utils/TemplateBuilder/SectionedDataHelper/SectionedDataHelper.ts +246 -0
  113. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js +17 -0
  114. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.js.map +7 -0
  115. package/dpr/utils/TemplateBuilder/SectionedDataHelper/types.ts +41 -0
  116. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.js → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js} +6 -8
  117. package/dpr/utils/TemplateBuilder/SummaryDataHelper/SummaryDataHelper.js.map +7 -0
  118. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.test.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.test.ts} +4 -4
  119. package/dpr/utils/{CollatedSummaryBuilder/CollatedSummaryBuilder.ts → TemplateBuilder/SummaryDataHelper/SummaryDataHelper.ts} +6 -9
  120. package/dpr/utils/TemplateBuilder/TemplateBuilder.js +74 -0
  121. package/dpr/utils/TemplateBuilder/TemplateBuilder.js.map +7 -0
  122. package/dpr/utils/TemplateBuilder/TemplateBuilder.ts +68 -0
  123. package/dpr/utils/definitionUtils.js +22 -2
  124. package/dpr/utils/definitionUtils.js.map +2 -2
  125. package/dpr/utils/definitionUtils.ts +26 -1
  126. package/package.json +1 -1
  127. package/dpr/DprLoadingHelper.js +0 -51
  128. package/dpr/DprLoadingHelper.js.map +0 -7
  129. package/dpr/DprLoadingHelper.ts +0 -27
  130. package/dpr/components/_reports/report/view.njk +0 -40
  131. package/dpr/components/_reports/report-actions/clientClass.js.map +0 -7
  132. package/dpr/components/_reports/report-actions/types.d.js.map +0 -7
  133. package/dpr/components/_reports/report-columns-form/clientClass.js.map +0 -7
  134. package/dpr/components/_reports/report-columns-form/utils.js.map +0 -7
  135. package/dpr/components/_reports/report-data-table/clientClass.js.map +0 -7
  136. package/dpr/components/_reports/report-data-table/types.d.js.map +0 -7
  137. package/dpr/components/_reports/report-data-table/utils.js +0 -123
  138. package/dpr/components/_reports/report-data-table/utils.js.map +0 -7
  139. package/dpr/components/_reports/report-data-table/utils.test.ts +0 -604
  140. package/dpr/components/_reports/report-data-table/utils.ts +0 -150
  141. package/dpr/components/_reports/report-data-table/view.njk +0 -24
  142. package/dpr/components/_reports/report-data-table-wrapper/view.njk +0 -27
  143. package/dpr/components/_reports/report-download-message/clientClass.js.map +0 -7
  144. package/dpr/components/_reports/report-no-data-message/styles.scss +0 -4
  145. package/dpr/components/_reports/report-no-data-message/view.njk +0 -13
  146. package/dpr/components/_reports/report-pagination/clientClass.js.map +0 -7
  147. package/dpr/components/_reports/report-print-message/view.njk +0 -8
  148. package/dpr/components/_reports/report-template/view.njk +0 -44
  149. package/dpr/components/_reports/report-wrapper/view.njk +0 -19
  150. package/dpr/components/loading-anim/styles.scss +0 -117
  151. package/dpr/components/loading-anim/view.njk +0 -18
  152. package/dpr/utils/CollatedSummaryBuilder/CollatedSummaryBuilder.js.map +0 -7
  153. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js +0 -202
  154. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.js.map +0 -7
  155. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.test.ts +0 -503
  156. package/dpr/utils/ParentChildDataTableBuilder/ParentChildDataTableBuilder.ts +0 -224
  157. package/dpr/utils/ParentChildDataTableBuilder/types.d.js.map +0 -7
  158. package/dpr/utils/ParentChildDataTableBuilder/types.d.ts +0 -11
  159. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js +0 -311
  160. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.js.map +0 -7
  161. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.test.ts +0 -492
  162. package/dpr/utils/SectionedDataTableBuilder/SectionedDataTableBuilder.ts +0 -342
  163. package/dpr/utils/SectionedDataTableBuilder/types.d.js.map +0 -7
  164. package/dpr/utils/SectionedDataTableBuilder/types.d.ts +0 -5
  165. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js +0 -146
  166. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.js.map +0 -7
  167. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.test.ts +0 -140
  168. package/dpr/utils/SectionedFieldsTableBuilder/SectionedFieldsTableBuilder.ts +0 -150
  169. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.js +0 -0
  170. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/actionsTemplate.ts +0 -0
  171. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/style.scss +0 -0
  172. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/types.d.js +0 -0
  173. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.js +0 -0
  174. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/utils.ts +0 -0
  175. /package/dpr/components/_reports/{report-actions → report-heading/report-actions}/view.njk +0 -0
  176. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/style.scss +0 -0
  177. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.js +0 -0
  178. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/types.d.ts +0 -0
  179. /package/dpr/components/_reports/{report-columns-form → report-heading/report-columns/report-columns-form}/view.njk +0 -0
  180. /package/dpr/components/_reports/{report-columns → report-heading/report-columns}/styles.scss +0 -0
  181. /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/style.scss +0 -0
  182. /package/dpr/components/_reports/{report-download-message → report-heading/report-download-message}/view.njk +0 -0
  183. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/style.scss +0 -0
  184. /package/dpr/components/_reports/{report-data-table → report-page/report-template/report-pagination}/types.d.js +0 -0
  185. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/types.d.ts +0 -0
  186. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.js +0 -0
  187. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.test.ts +0 -0
  188. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/utils.ts +0 -0
  189. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-pagination}/view.njk +0 -0
  190. /package/dpr/components/_reports/{report-pagination → report-page/report-template/report-section/report-data-table}/types.d.js +0 -0
  191. /package/dpr/components/_reports/{report-summary-table → report-page/report-template/report-summary-table}/view.njk +0 -0
  192. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/style.scss +0 -0
  193. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.js +0 -0
  194. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/utils.ts +0 -0
  195. /package/dpr/components/_reports/{report-totals → report-page/report-template/report-totals}/view.njk +0 -0
  196. /package/dpr/utils/{ParentChildDataTableBuilder → TemplateBuilder/ParentChildDataBuilder}/types.d.js +0 -0
  197. /package/dpr/utils/{SectionedDataTableBuilder → TemplateBuilder/ReportBuilder}/types.d.js +0 -0
@@ -7,70 +7,221 @@ context("Viewing a report", () => {
7
7
  (0, import_cypressUtils.stubBaseTasks)();
8
8
  (0, import_cypressUtils.executeReportStubs)();
9
9
  });
10
- it("should display a list-section variant", () => {
11
- cy.task("stubListSectionDefinitionRequest");
12
- cy.task("stubResultSuccessResult");
13
- cy.visit(path);
14
- (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Successful Report", description: "this will succeed" });
15
- cy.findByRole("heading", { level: 1, name: /Sectioned/ }).should("be.visible");
16
- cy.findAllByRole("heading", { name: /First.*Second/ }).should("have.length", 4);
17
- cy.findByRole("heading", { name: /First: One, Second: A 4 results/ }).should("be.visible");
18
- cy.findByRole("heading", { name: /First: One, Second: B 6 results/ }).should("be.visible");
19
- cy.findByRole("heading", { name: /First: Two, Second: A 3 results/ }).should("be.visible");
20
- cy.findByRole("heading", { name: /First: Two, Second: B 7 results/ }).should("be.visible");
21
- });
22
- it("should display a parent-child variant", () => {
23
- cy.task("stubParentChildDefinitionRequest");
24
- cy.task("stubResultSuccessResultDifferentValues");
25
- cy.visit(path);
26
- (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Successful Report", description: "this will succeed" });
27
- cy.findByRole("heading", { level: 1, name: /Parent Child Template/ }).should("be.visible");
28
- cy.contains("table", "val40").within(() => {
29
- cy.findAllByRole("row").should("have.length", 8);
30
- [40, 41, 42, 43, 44, 45, 46].forEach((num) => {
31
- cy.findByRole("row", { name: new RegExp(`val${num}$`) }).should("be.visible");
10
+ describe("list-section", () => {
11
+ const listSectionReport = {
12
+ name: "List-section",
13
+ description: "list-section template"
14
+ };
15
+ beforeEach(() => {
16
+ cy.task("stubListSectionDefinitionRequest");
17
+ cy.task("stubResultSuccessResult");
18
+ });
19
+ it("should display a list-section variant", () => {
20
+ cy.visit(path);
21
+ (0, import_cypressUtils.requestReportByNameAndDescription)(listSectionReport);
22
+ cy.findByRole("heading", { level: 1, name: /List-section/ });
23
+ cy.findAllByRole("heading", { name: /First.*Second/ }).should("have.length", 4);
24
+ cy.findByRole("heading", { name: /First: One, Second: A 4 results/ }).should("be.visible").scrollIntoView();
25
+ cy.findByRole("heading", { name: /First: One, Second: B 6 results/ }).should("be.visible").scrollIntoView();
26
+ cy.findByRole("heading", { name: /First: Two, Second: A 3 results/ }).should("be.visible").scrollIntoView();
27
+ cy.findByRole("heading", { name: /First: Two, Second: B 7 results/ }).should("be.visible").scrollIntoView();
28
+ cy.findAllByLabelText(/First: One, Second: A 4 results/).eq(1).within(() => {
29
+ cy.findAllByRole("table").should("have.length", 1);
30
+ });
31
+ cy.findAllByLabelText(/First: One, Second: B 6 results/).eq(1).within(() => {
32
+ cy.findAllByRole("table").should("have.length", 1);
33
+ });
34
+ cy.findAllByLabelText(/First: Two, Second: A 3 results/).eq(1).within(() => {
35
+ cy.findAllByRole("table").should("have.length", 1);
36
+ });
37
+ cy.findAllByLabelText(/First: Two, Second: B 7 results/).eq(1).within(() => {
38
+ cy.findAllByRole("table").should("have.length", 1);
32
39
  });
33
40
  });
34
- cy.contains("table", "val30").within(() => {
35
- cy.findAllByRole("row").should("have.length", 14);
36
- [...Array(10).keys()].map((i) => i + 30).forEach((num) => {
37
- cy.findByRole("row", { name: new RegExp(`val${num}$`) }).should("be.visible");
41
+ it("should sort the sections correctly", () => {
42
+ cy.visit(path);
43
+ (0, import_cypressUtils.startReportRequest)(listSectionReport);
44
+ cy.findByRole("group", { name: /Column/ }).findByRole("radio", { name: "Second" }).check();
45
+ cy.findByRole("button", { name: /Request/ }).click();
46
+ cy.findByRole("heading", { level: 1, name: /List-section/ });
47
+ cy.findAllByRole("heading", { name: /First.*Second/ }).should("have.length", 4).each((heading, index) => {
48
+ switch (index) {
49
+ case 0:
50
+ cy.wrap(heading).contains("First: One, Second: A 4 results");
51
+ break;
52
+ case 1:
53
+ cy.wrap(heading).contains("First: Two, Second: A 3 results");
54
+ break;
55
+ case 2:
56
+ cy.wrap(heading).contains("First: One, Second: B 6 results");
57
+ break;
58
+ case 3:
59
+ cy.wrap(heading).contains("First: Two, Second: B 7 results");
60
+ break;
61
+ default:
62
+ break;
63
+ }
64
+ });
65
+ });
66
+ });
67
+ describe("summary-section", () => {
68
+ it("should display a summary section variant", () => {
69
+ cy.task("stubSummarySectionDefinitionRequest");
70
+ cy.task("stubAsyncSummaryReport");
71
+ cy.task("stubResultSuccessResultDifferentValues");
72
+ cy.visit(path);
73
+ (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Summary-section", description: "Summary-section template" });
74
+ cy.findByRole("heading", { level: 1, name: /Summary-section/ }).should("be.visible");
75
+ cy.findAllByLabelText(/First: One, Second: A/).eq(0).within(() => {
76
+ cy.findAllByRole("table").should("have.length", 2).each((table) => {
77
+ cy.wrap(table).within(() => {
78
+ cy.findAllByRole("row").should("have.length", 5);
79
+ });
80
+ });
81
+ });
82
+ cy.findAllByLabelText(/First: One, Second: B/).eq(0).within(() => {
83
+ cy.findAllByRole("table").should("have.length", 2).each((table) => {
84
+ cy.wrap(table).within(() => {
85
+ cy.findAllByRole("row").should("have.length", 7);
86
+ });
87
+ });
88
+ });
89
+ cy.findAllByLabelText(/First: Two, Second: A/).eq(0).within(() => {
90
+ cy.findAllByRole("table").should("have.length", 2).each((table) => {
91
+ cy.wrap(table).within(() => {
92
+ cy.findAllByRole("row").should("have.length", 4);
93
+ });
94
+ });
95
+ });
96
+ cy.findAllByLabelText(/First: Two, Second: B/).eq(0).within(() => {
97
+ cy.findAllByRole("table").should("have.length", 2).each((table) => {
98
+ cy.wrap(table).within(() => {
99
+ cy.findAllByRole("row").should("have.length", 8);
100
+ });
101
+ });
38
102
  });
39
- cy.findByRole("row", { name: /val330/ }).should("be.visible");
40
- cy.findByRole("row", { name: /val331/ }).should("be.visible");
41
- cy.findByRole("row", { name: /val332/ }).should("be.visible");
42
103
  });
43
104
  });
44
- it("should display a summary section variant", () => {
45
- cy.task("stubSummarySectionDefinitionRequest");
46
- cy.task("stubAsyncSummaryReport");
47
- cy.task("stubResultSuccessResultDifferentValues");
48
- cy.visit(path);
49
- (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Successful Report", description: "this will succeed" });
50
- cy.findByRole("heading", { level: 1, name: /Sectioned Summaries template/ }).should("be.visible");
51
- cy.findAllByRole("columnheader").should("have.length", 8 * 4);
52
- cy.get(".report-template-container").within(() => {
53
- cy.findAllByRole("row").should("have.length", 48);
105
+ describe("parent-child-section", () => {
106
+ const ParentChildSectionReport = {
107
+ name: "Parent-child-section",
108
+ description: "Parent-child-section template"
109
+ };
110
+ beforeEach(() => {
111
+ cy.task("stubParentChildSectionDefinitionRequest");
112
+ cy.task("stubResultSuccessResultDifferentValues");
113
+ });
114
+ it("should display a parent child section variant", () => {
115
+ cy.visit(path);
116
+ (0, import_cypressUtils.requestReportByNameAndDescription)(ParentChildSectionReport);
117
+ cy.findByRole("heading", { level: 1, name: /Parent-child-section/ }).should("be.visible");
118
+ cy.findByRole("heading", { name: /Section 1: One, Section 2: A 5 results/ }).scrollIntoView().should("be.visible");
119
+ cy.findByRole("heading", { name: /Section 1: One, Section 2: B 2 results/ }).scrollIntoView().should("be.visible");
120
+ cy.findByRole("heading", { name: /Section 1: Two, Section 2: A 8 results/ }).scrollIntoView().should("be.visible");
121
+ cy.findByRole("heading", { name: /Section 1: Two, Section 2: B 5 results/ }).scrollIntoView().should("be.visible");
122
+ cy.findAllByLabelText("Section 1: One, Section 2: A 5 results").eq(1).within(() => {
123
+ cy.findAllByRole("table").should("have.length", 10);
124
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
125
+ cy.findAllByRole("table").should("have.length", 2);
126
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
127
+ cy.findByRole("table").within(() => {
128
+ cy.findAllByRole("row").should("have.length", 4);
129
+ });
130
+ });
131
+ cy.findAllByLabelText("Child Report").eq(0).within(() => {
132
+ cy.findByRole("table").within(() => {
133
+ cy.findAllByRole("row").should("have.length", 23);
134
+ });
135
+ });
136
+ });
137
+ });
138
+ cy.findAllByLabelText("Section 1: Two, Section 2: A 8 results").eq(1).within(() => {
139
+ cy.findAllByRole("table").should("have.length", 16);
140
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
141
+ cy.findAllByRole("table").should("have.length", 2);
142
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
143
+ cy.findByRole("table").within(() => {
144
+ cy.findAllByRole("row").should("have.length", 4);
145
+ });
146
+ });
147
+ cy.findAllByLabelText("Child Report").eq(0).within(() => {
148
+ cy.findByRole("table").within(() => {
149
+ cy.findAllByRole("row").should("have.length", 23);
150
+ });
151
+ });
152
+ });
153
+ });
154
+ });
155
+ it("should sort the sections correctly", () => {
156
+ cy.visit(path);
157
+ (0, import_cypressUtils.startReportRequest)(ParentChildSectionReport);
158
+ cy.findByRole("group", { name: /Column/ }).findByRole("radio", { name: "Section 2" }).check();
159
+ cy.findByRole("button", { name: /Request/ }).click();
160
+ cy.findByRole("heading", { level: 1, name: /Parent-child-section/ }).should("be.visible");
161
+ cy.findAllByRole("heading", { name: /Section 1.*Section 2/ }).should("have.length", 4).each((heading, index) => {
162
+ switch (index) {
163
+ case 0:
164
+ cy.wrap(heading).contains("Section 1: One, Section 2: A 5 results");
165
+ break;
166
+ case 1:
167
+ cy.wrap(heading).contains("Section 1: Two, Section 2: A 8 results");
168
+ break;
169
+ case 2:
170
+ cy.wrap(heading).contains("Section 1: One, Section 2: B 2 results");
171
+ break;
172
+ case 3:
173
+ cy.wrap(heading).contains("Section 1: Two, Section 2: B 5 results");
174
+ break;
175
+ default:
176
+ break;
177
+ }
178
+ });
54
179
  });
55
180
  });
56
- it("should display a parent child section variant", () => {
57
- cy.task("stubParentChildSectionDefinitionRequest");
58
- cy.task("stubResultSuccessResultDifferentValues");
59
- cy.visit(path);
60
- (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Successful Report", description: "this will succeed" });
61
- cy.findByRole("heading", { level: 1, name: /Parent Child Section Template/ }).should("be.visible");
62
- cy.contains("table", "val30").within(() => {
63
- cy.findAllByRole("row").should("have.length", 21);
181
+ describe("parent-child", () => {
182
+ it("should display a parent-child variant", () => {
183
+ cy.task("stubParentChildDefinitionRequest");
184
+ cy.task("stubResultSuccessResultDifferentValues");
185
+ cy.visit(path);
186
+ (0, import_cypressUtils.requestReportByNameAndDescription)({ name: "Parent-child", description: "Parent-child template" });
187
+ cy.findByRole("heading", { level: 1, name: /Parent-child/ }).should("be.visible");
188
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
189
+ cy.findAllByRole("table").should("have.length", 3);
190
+ cy.findAllByLabelText("Parent 1").eq(0).within(() => {
191
+ cy.findByRole("table").within(() => {
192
+ cy.findAllByRole("row").should("have.length", 4);
193
+ });
194
+ });
195
+ cy.findAllByLabelText("Child Report").eq(0).within(() => {
196
+ cy.findByRole("table").within(() => {
197
+ cy.findAllByRole("row").should("have.length", 10);
198
+ });
199
+ });
200
+ cy.findAllByLabelText("Child Report 2").eq(0).within(() => {
201
+ cy.findByRole("table").within(() => {
202
+ cy.findAllByRole("row").should("have.length", 10);
203
+ });
204
+ });
205
+ });
206
+ cy.findAllByLabelText("Parent 8").eq(0).within(() => {
207
+ cy.findAllByRole("table").should("have.length", 3);
208
+ cy.findAllByLabelText("Parent 8").eq(0).within(() => {
209
+ cy.findByRole("table").within(() => {
210
+ cy.findAllByRole("row").should("have.length", 4);
211
+ });
212
+ });
213
+ cy.findAllByLabelText("Child Report").eq(0).within(() => {
214
+ cy.findByRole("table").within(() => {
215
+ cy.findAllByRole("row").should("have.length", 16);
216
+ });
217
+ });
218
+ cy.findAllByLabelText("Child Report 2").eq(0).within(() => {
219
+ cy.findByRole("table").within(() => {
220
+ cy.findAllByRole("row").should("have.length", 16);
221
+ });
222
+ });
223
+ });
64
224
  });
65
- cy.findByRole("heading", { name: /Section 1: One, Section 2: A 5 results/ }).should("be.visible");
66
- cy.findByRole("heading", { name: /Section 1: One, Section 2: B 2 results/ }).should("be.visible");
67
- cy.findByRole("heading", { name: /Section 1: Two, Section 2: A 8 results/ }).should("be.visible");
68
- cy.findByRole("heading", { name: /Section 1: Two, Section 2: B 5 results/ }).should("be.visible");
69
- cy.findAllByRole("row", {
70
- name: (textContent) => {
71
- return textContent.includes("val");
72
- }
73
- }).filter((_idx, el) => [...el.querySelectorAll("td")].length === 2).should("have.length", 100);
74
225
  });
75
226
  });
76
227
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../dpr/routes/journeys/view-report/async/report/report-variants.cy.ts"],
4
- "sourcesContent": ["import { executeReportStubs, requestReportByNameAndDescription, stubBaseTasks } from 'cypress-tests/cypressUtils'\n\ncontext('Viewing a report', () => {\n const path = '/embedded/platform/'\n\n describe('report variants', () => {\n before(() => {\n stubBaseTasks()\n executeReportStubs()\n })\n\n it('should display a list-section variant', () => {\n cy.task('stubListSectionDefinitionRequest')\n cy.task('stubResultSuccessResult')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Successful Report', description: 'this will succeed' })\n cy.findByRole('heading', { level: 1, name: /Sectioned/ }).should('be.visible')\n\n cy.findAllByRole('heading', { name: /First.*Second/ }).should('have.length', 4)\n cy.findByRole('heading', { name: /First: One, Second: A 4 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /First: One, Second: B 6 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /First: Two, Second: A 3 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /First: Two, Second: B 7 results/ }).should('be.visible')\n })\n\n it('should display a parent-child variant', () => {\n cy.task('stubParentChildDefinitionRequest')\n cy.task('stubResultSuccessResultDifferentValues')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Successful Report', description: 'this will succeed' })\n cy.findByRole('heading', { level: 1, name: /Parent Child Template/ }).should('be.visible')\n\n cy.contains('table', 'val40').within(() => {\n cy.findAllByRole('row').should('have.length', 8)\n ;[40, 41, 42, 43, 44, 45, 46].forEach((num) => {\n cy.findByRole('row', { name: new RegExp(`val${num}$`) }).should('be.visible')\n })\n })\n\n cy.contains('table', 'val30').within(() => {\n cy.findAllByRole('row').should('have.length', 14)\n ;[...Array(10).keys()]\n .map((i) => i + 30)\n .forEach((num) => {\n cy.findByRole('row', { name: new RegExp(`val${num}$`) }).should('be.visible')\n })\n cy.findByRole('row', { name: /val330/ }).should('be.visible')\n cy.findByRole('row', { name: /val331/ }).should('be.visible')\n cy.findByRole('row', { name: /val332/ }).should('be.visible')\n })\n })\n\n it('should display a summary section variant', () => {\n cy.task('stubSummarySectionDefinitionRequest')\n cy.task('stubAsyncSummaryReport')\n cy.task('stubResultSuccessResultDifferentValues')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Successful Report', description: 'this will succeed' })\n cy.findByRole('heading', { level: 1, name: /Sectioned Summaries template/ }).should('be.visible')\n\n cy.findAllByRole('columnheader').should('have.length', 8 * 4)\n cy.get('.report-template-container').within(() => {\n cy.findAllByRole('row').should('have.length', 48)\n })\n })\n\n it('should display a parent child section variant', () => {\n cy.task('stubParentChildSectionDefinitionRequest')\n cy.task('stubResultSuccessResultDifferentValues')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Successful Report', description: 'this will succeed' })\n cy.findByRole('heading', { level: 1, name: /Parent Child Section Template/ }).should('be.visible')\n\n // First child table\n cy.contains('table', 'val30').within(() => {\n cy.findAllByRole('row').should('have.length', 21)\n })\n cy.findByRole('heading', { name: /Section 1: One, Section 2: A 5 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /Section 1: One, Section 2: B 2 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /Section 1: Two, Section 2: A 8 results/ }).should('be.visible')\n cy.findByRole('heading', { name: /Section 1: Two, Section 2: B 5 results/ }).should('be.visible')\n // This is the best we can do for now until this report type gets refactored\n cy.findAllByRole('row', {\n name: (textContent) => {\n return textContent.includes('val')\n },\n })\n .filter((_idx, el) => [...el.querySelectorAll('td')].length === 2)\n .should('have.length', 100)\n })\n })\n})\n"],
5
- "mappings": ";AAAA,0BAAqF;AAErF,QAAQ,oBAAoB,MAAM;AAChC,QAAM,OAAO;AAEb,WAAS,mBAAmB,MAAM;AAChC,WAAO,MAAM;AACX,6CAAc;AACd,kDAAmB;AAAA,IACrB,CAAC;AAED,OAAG,yCAAyC,MAAM;AAChD,SAAG,KAAK,kCAAkC;AAC1C,SAA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SAAG,WAAW,WAAW,EAAE,MAAM,yCAAyC,CAAC,EAAE,OAAO,YAAY;AAChG,SAAG,WAAW,WAAW,EAAE,MAAM,yCAAyC,CAAC,EAAE,OAAO,YAAY;AAChG,SAAG,WAAW,WAAW,EAAE,MAAM,yCAAyC,CAAC,EAAE,OAAO,YAAY;AAChG,SAAG,WAAW,WAAW,EAAE,MAAM,yCAAyC,CAAC,EAAE,OAAO,YAAY;AAEhG,SAAG,cAAc,OAAO;AAAA,QACtB,MAAM,CAAC,gBAAgB;AACrB,iBAAO,YAAY,SAAS,KAAK;AAAA,QACnC;AAAA,MACF,CAAC,EACE,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,GAAG,iBAAiB,IAAI,CAAC,EAAE,WAAW,CAAC,EAChE,OAAO,eAAe,GAAG;AAAA,IAC9B,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import {\n executeReportStubs,\n requestReportByNameAndDescription,\n stubBaseTasks,\n startReportRequest,\n} from 'cypress-tests/cypressUtils'\n\ncontext('Viewing a report', () => {\n const path = '/embedded/platform/'\n\n describe('report variants', () => {\n before(() => {\n stubBaseTasks()\n executeReportStubs()\n })\n\n describe('list-section', () => {\n const listSectionReport = {\n name: 'List-section',\n description: 'list-section template',\n }\n\n beforeEach(() => {\n cy.task('stubListSectionDefinitionRequest')\n cy.task('stubResultSuccessResult')\n })\n\n it('should display a list-section variant', () => {\n cy.visit(path)\n requestReportByNameAndDescription(listSectionReport)\n cy.findByRole('heading', { level: 1, name: /List-section/ })\n cy.findAllByRole('heading', { name: /First.*Second/ }).should('have.length', 4)\n\n // Test headings exist\n cy.findByRole('heading', { name: /First: One, Second: A 4 results/ })\n .should('be.visible')\n .scrollIntoView()\n cy.findByRole('heading', { name: /First: One, Second: B 6 results/ })\n .should('be.visible')\n .scrollIntoView()\n cy.findByRole('heading', { name: /First: Two, Second: A 3 results/ })\n .should('be.visible')\n .scrollIntoView()\n cy.findByRole('heading', { name: /First: Two, Second: B 7 results/ })\n .should('be.visible')\n .scrollIntoView()\n\n // Test they only include 1 table per section\n cy.findAllByLabelText(/First: One, Second: A 4 results/)\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 1)\n })\n cy.findAllByLabelText(/First: One, Second: B 6 results/)\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 1)\n })\n cy.findAllByLabelText(/First: Two, Second: A 3 results/)\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 1)\n })\n cy.findAllByLabelText(/First: Two, Second: B 7 results/)\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 1)\n })\n })\n\n it('should sort the sections correctly', () => {\n cy.visit(path)\n startReportRequest(listSectionReport)\n cy.findByRole('group', { name: /Column/ })\n .findByRole('radio', { name: 'Second' })\n .check()\n cy.findByRole('button', { name: /Request/ }).click()\n\n cy.findByRole('heading', { level: 1, name: /List-section/ })\n cy.findAllByRole('heading', { name: /First.*Second/ })\n .should('have.length', 4)\n .each((heading, index) => {\n switch (index) {\n case 0:\n cy.wrap(heading).contains('First: One, Second: A 4 results')\n break\n case 1:\n cy.wrap(heading).contains('First: Two, Second: A 3 results')\n break\n case 2:\n cy.wrap(heading).contains('First: One, Second: B 6 results')\n break\n case 3:\n cy.wrap(heading).contains('First: Two, Second: B 7 results')\n break\n default:\n break\n }\n })\n })\n })\n\n describe('summary-section', () => {\n it('should display a summary section variant', () => {\n cy.task('stubSummarySectionDefinitionRequest')\n cy.task('stubAsyncSummaryReport')\n cy.task('stubResultSuccessResultDifferentValues')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Summary-section', description: 'Summary-section template' })\n cy.findByRole('heading', { level: 1, name: /Summary-section/ }).should('be.visible')\n\n cy.findAllByLabelText(/First: One, Second: A/)\n .eq(0)\n .within(() => {\n cy.findAllByRole('table')\n .should('have.length', 2)\n .each((table) => {\n cy.wrap(table).within(() => {\n cy.findAllByRole('row').should('have.length', 5)\n })\n })\n })\n\n cy.findAllByLabelText(/First: One, Second: B/)\n .eq(0)\n .within(() => {\n cy.findAllByRole('table')\n .should('have.length', 2)\n .each((table) => {\n cy.wrap(table).within(() => {\n cy.findAllByRole('row').should('have.length', 7)\n })\n })\n })\n\n cy.findAllByLabelText(/First: Two, Second: A/)\n .eq(0)\n .within(() => {\n cy.findAllByRole('table')\n .should('have.length', 2)\n .each((table) => {\n cy.wrap(table).within(() => {\n cy.findAllByRole('row').should('have.length', 4)\n })\n })\n })\n\n cy.findAllByLabelText(/First: Two, Second: B/)\n .eq(0)\n .within(() => {\n cy.findAllByRole('table')\n .should('have.length', 2)\n .each((table) => {\n cy.wrap(table).within(() => {\n cy.findAllByRole('row').should('have.length', 8)\n })\n })\n })\n })\n })\n\n describe('parent-child-section', () => {\n const ParentChildSectionReport = {\n name: 'Parent-child-section',\n description: 'Parent-child-section template',\n }\n\n beforeEach(() => {\n cy.task('stubParentChildSectionDefinitionRequest')\n cy.task('stubResultSuccessResultDifferentValues')\n })\n\n it('should display a parent child section variant', () => {\n cy.visit(path)\n requestReportByNameAndDescription(ParentChildSectionReport)\n cy.findByRole('heading', { level: 1, name: /Parent-child-section/ }).should('be.visible')\n\n cy.findByRole('heading', { name: /Section 1: One, Section 2: A 5 results/ })\n .scrollIntoView()\n .should('be.visible')\n cy.findByRole('heading', { name: /Section 1: One, Section 2: B 2 results/ })\n .scrollIntoView()\n .should('be.visible')\n cy.findByRole('heading', { name: /Section 1: Two, Section 2: A 8 results/ })\n .scrollIntoView()\n .should('be.visible')\n cy.findByRole('heading', { name: /Section 1: Two, Section 2: B 5 results/ })\n .scrollIntoView()\n .should('be.visible')\n\n cy.findAllByLabelText('Section 1: One, Section 2: A 5 results')\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 10)\n\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 2)\n\n // parent\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 4)\n })\n })\n\n // Child\n cy.findAllByLabelText('Child Report')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 23)\n })\n })\n })\n })\n\n cy.findAllByLabelText('Section 1: Two, Section 2: A 8 results')\n .eq(1)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 16)\n\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 2)\n\n // parent\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 4)\n })\n })\n\n // Child\n cy.findAllByLabelText('Child Report')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 23)\n })\n })\n })\n })\n })\n\n it('should sort the sections correctly', () => {\n cy.visit(path)\n startReportRequest(ParentChildSectionReport)\n cy.findByRole('group', { name: /Column/ })\n .findByRole('radio', { name: 'Section 2' })\n .check()\n cy.findByRole('button', { name: /Request/ }).click()\n\n cy.findByRole('heading', { level: 1, name: /Parent-child-section/ }).should('be.visible')\n\n cy.findAllByRole('heading', { name: /Section 1.*Section 2/ })\n .should('have.length', 4)\n .each((heading, index) => {\n switch (index) {\n case 0:\n cy.wrap(heading).contains('Section 1: One, Section 2: A 5 results')\n break\n case 1:\n cy.wrap(heading).contains('Section 1: Two, Section 2: A 8 results')\n break\n case 2:\n cy.wrap(heading).contains('Section 1: One, Section 2: B 2 results')\n break\n case 3:\n cy.wrap(heading).contains('Section 1: Two, Section 2: B 5 results')\n break\n default:\n break\n }\n })\n })\n })\n\n describe('parent-child', () => {\n it('should display a parent-child variant', () => {\n cy.task('stubParentChildDefinitionRequest')\n cy.task('stubResultSuccessResultDifferentValues')\n\n cy.visit(path)\n requestReportByNameAndDescription({ name: 'Parent-child', description: 'Parent-child template' })\n cy.findByRole('heading', { level: 1, name: /Parent-child/ }).should('be.visible')\n\n // Parent child group\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 3)\n\n // parent\n cy.findAllByLabelText('Parent 1')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 4)\n })\n })\n\n // child\n cy.findAllByLabelText('Child Report')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 10)\n })\n })\n\n // child 2\n cy.findAllByLabelText('Child Report 2')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 10)\n })\n })\n })\n\n // Parent child group\n cy.findAllByLabelText('Parent 8')\n .eq(0)\n .within(() => {\n cy.findAllByRole('table').should('have.length', 3)\n\n // parent\n cy.findAllByLabelText('Parent 8')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 4)\n })\n })\n\n // child\n cy.findAllByLabelText('Child Report')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 16)\n })\n })\n\n // child 2\n cy.findAllByLabelText('Child Report 2')\n .eq(0)\n .within(() => {\n cy.findByRole('table').within(() => {\n cy.findAllByRole('row').should('have.length', 16)\n })\n })\n })\n })\n })\n })\n})\n"],
5
+ "mappings": ";AAAA,0BAKO;AAEP,QAAQ,oBAAoB,MAAM;AAChC,QAAM,OAAO;AAEb,WAAS,mBAAmB,MAAM;AAChC,WAAO,MAAM;AACX,6CAAc;AACd,kDAAmB;AAAA,IACrB,CAAC;AAED,aAAS,gBAAgB,MAAM;AAC7B,YAAM,oBAAoB;AAAA,QACxB,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAEA,iBAAW,MAAM;AACf,WAAG,KAAK,kCAAkC;AAC1C,WAAG,KAAK,yBAAyB;AAAA,MACnC,CAAC;AAED,SAAG,yCAAyC,MAAM;AACh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