@cucumber/react-components 24.2.0 → 24.3.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 (415) hide show
  1. package/LICENSE +1 -1
  2. package/dist/src/CucumberQueryContext.d.ts +1 -2
  3. package/dist/src/CucumberQueryContext.d.ts.map +1 -1
  4. package/dist/src/CucumberQueryContext.js +2 -2
  5. package/dist/src/CucumberQueryContext.js.map +1 -1
  6. package/dist/src/GherkinQueryContext.d.ts +1 -2
  7. package/dist/src/GherkinQueryContext.d.ts.map +1 -1
  8. package/dist/src/GherkinQueryContext.js +2 -2
  9. package/dist/src/GherkinQueryContext.js.map +1 -1
  10. package/dist/src/SearchContext.d.ts +11 -5
  11. package/dist/src/SearchContext.d.ts.map +1 -1
  12. package/dist/src/SearchContext.js +4 -2
  13. package/dist/src/SearchContext.js.map +1 -1
  14. package/dist/src/ciCommitLink.d.ts +1 -1
  15. package/dist/src/ciCommitLink.d.ts.map +1 -1
  16. package/dist/src/ciCommitLink.js +1 -1
  17. package/dist/src/ciCommitLink.js.map +1 -1
  18. package/dist/src/components/app/CICommitLink.d.ts +2 -2
  19. package/dist/src/components/app/CICommitLink.d.ts.map +1 -1
  20. package/dist/src/components/app/CICommitLink.js +3 -8
  21. package/dist/src/components/app/CICommitLink.js.map +1 -1
  22. package/dist/src/components/app/CIJobLink.d.ts +2 -2
  23. package/dist/src/components/app/CIJobLink.d.ts.map +1 -1
  24. package/dist/src/components/app/CIJobLink.js +3 -7
  25. package/dist/src/components/app/CIJobLink.js.map +1 -1
  26. package/dist/src/components/app/ControlledSearchProvider.d.ts +2 -2
  27. package/dist/src/components/app/ControlledSearchProvider.d.ts.map +1 -1
  28. package/dist/src/components/app/ControlledSearchProvider.js +24 -2
  29. package/dist/src/components/app/ControlledSearchProvider.js.map +1 -1
  30. package/dist/src/components/app/CopyButton.d.ts +2 -1
  31. package/dist/src/components/app/CopyButton.d.ts.map +1 -1
  32. package/dist/src/components/app/CopyButton.js +4 -4
  33. package/dist/src/components/app/CopyButton.js.map +1 -1
  34. package/dist/src/components/app/DocumentAccordion.d.ts +3 -3
  35. package/dist/src/components/app/DocumentAccordion.d.ts.map +1 -1
  36. package/dist/src/components/app/DocumentAccordion.js +12 -20
  37. package/dist/src/components/app/DocumentAccordion.js.map +1 -1
  38. package/dist/src/components/app/DocumentAccordion.module.scss +15 -7
  39. package/dist/src/components/app/EnvelopesProvider.d.ts +2 -2
  40. package/dist/src/components/app/EnvelopesProvider.d.ts.map +1 -1
  41. package/dist/src/components/app/EnvelopesProvider.js +3 -2
  42. package/dist/src/components/app/EnvelopesProvider.js.map +1 -1
  43. package/dist/src/components/app/ExecutionSummary.d.ts +1 -1
  44. package/dist/src/components/app/ExecutionSummary.d.ts.map +1 -1
  45. package/dist/src/components/app/ExecutionSummary.js +3 -49
  46. package/dist/src/components/app/ExecutionSummary.js.map +1 -1
  47. package/dist/src/components/app/FilteredDocuments.d.ts +1 -1
  48. package/dist/src/components/app/FilteredDocuments.d.ts.map +1 -1
  49. package/dist/src/components/app/FilteredDocuments.js +4 -4
  50. package/dist/src/components/app/FilteredDocuments.js.map +1 -1
  51. package/dist/src/components/app/GherkinDocumentList.d.ts +3 -3
  52. package/dist/src/components/app/GherkinDocumentList.d.ts.map +1 -1
  53. package/dist/src/components/app/GherkinDocumentList.js +8 -9
  54. package/dist/src/components/app/GherkinDocumentList.js.map +1 -1
  55. package/dist/src/components/app/Header.d.ts +1 -1
  56. package/dist/src/components/app/Header.d.ts.map +1 -1
  57. package/dist/src/components/app/Header.js +4 -4
  58. package/dist/src/components/app/Header.js.map +1 -1
  59. package/dist/src/components/app/HealthChart.d.ts +1 -1
  60. package/dist/src/components/app/HealthChart.d.ts.map +1 -1
  61. package/dist/src/components/app/HealthChart.js +6 -7
  62. package/dist/src/components/app/HealthChart.js.map +1 -1
  63. package/dist/src/components/app/HighLight.d.ts +2 -2
  64. package/dist/src/components/app/HighLight.d.ts.map +1 -1
  65. package/dist/src/components/app/HighLight.js +15 -9
  66. package/dist/src/components/app/HighLight.js.map +1 -1
  67. package/dist/src/components/app/ImplementationIcon.d.ts +2 -2
  68. package/dist/src/components/app/ImplementationIcon.d.ts.map +1 -1
  69. package/dist/src/components/app/ImplementationIcon.js +2 -2
  70. package/dist/src/components/app/ImplementationIcon.js.map +1 -1
  71. package/dist/src/components/app/InMemorySearchProvider.d.ts +2 -2
  72. package/dist/src/components/app/InMemorySearchProvider.d.ts.map +1 -1
  73. package/dist/src/components/app/InMemorySearchProvider.js +3 -2
  74. package/dist/src/components/app/InMemorySearchProvider.js.map +1 -1
  75. package/dist/src/components/app/NavigationButton.d.ts +1 -1
  76. package/dist/src/components/app/NavigationButton.d.ts.map +1 -1
  77. package/dist/src/components/app/NavigationButton.js +2 -2
  78. package/dist/src/components/app/NavigationButton.js.map +1 -1
  79. package/dist/src/components/app/OSIcon.d.ts +2 -2
  80. package/dist/src/components/app/OSIcon.d.ts.map +1 -1
  81. package/dist/src/components/app/OSIcon.js +4 -4
  82. package/dist/src/components/app/OSIcon.js.map +1 -1
  83. package/dist/src/components/app/QueriesProvider.d.ts +3 -3
  84. package/dist/src/components/app/QueriesProvider.d.ts.map +1 -1
  85. package/dist/src/components/app/QueriesProvider.js +4 -3
  86. package/dist/src/components/app/QueriesProvider.js.map +1 -1
  87. package/dist/src/components/app/Report.d.ts +1 -1
  88. package/dist/src/components/app/Report.d.ts.map +1 -1
  89. package/dist/src/components/app/Report.js +2 -11
  90. package/dist/src/components/app/Report.js.map +1 -1
  91. package/dist/src/components/app/RuntimeIcon.d.ts +2 -2
  92. package/dist/src/components/app/RuntimeIcon.d.ts.map +1 -1
  93. package/dist/src/components/app/RuntimeIcon.js +4 -4
  94. package/dist/src/components/app/RuntimeIcon.js.map +1 -1
  95. package/dist/src/components/app/SearchBar.d.ts +1 -1
  96. package/dist/src/components/app/SearchBar.d.ts.map +1 -1
  97. package/dist/src/components/app/SearchBar.js +9 -24
  98. package/dist/src/components/app/SearchBar.js.map +1 -1
  99. package/dist/src/components/app/StatusesSummary.d.ts +1 -1
  100. package/dist/src/components/app/StatusesSummary.d.ts.map +1 -1
  101. package/dist/src/components/app/StatusesSummary.js +8 -11
  102. package/dist/src/components/app/StatusesSummary.js.map +1 -1
  103. package/dist/src/components/app/TestRunHooks.d.ts +1 -1
  104. package/dist/src/components/app/TestRunHooks.d.ts.map +1 -1
  105. package/dist/src/components/app/TestRunHooks.js +5 -5
  106. package/dist/src/components/app/TestRunHooks.js.map +1 -1
  107. package/dist/src/components/app/UrlSearchProvider.d.ts +1 -1
  108. package/dist/src/components/app/UrlSearchProvider.d.ts.map +1 -1
  109. package/dist/src/components/app/UrlSearchProvider.js +6 -3
  110. package/dist/src/components/app/UrlSearchProvider.js.map +1 -1
  111. package/dist/src/components/app/icons/CucumberLogo.d.ts +1 -1
  112. package/dist/src/components/app/icons/CucumberLogo.d.ts.map +1 -1
  113. package/dist/src/components/app/icons/CucumberLogo.js +2 -6
  114. package/dist/src/components/app/icons/CucumberLogo.js.map +1 -1
  115. package/dist/src/components/app/icons/Jvm.d.ts +1 -1
  116. package/dist/src/components/app/icons/Jvm.d.ts.map +1 -1
  117. package/dist/src/components/app/icons/Jvm.js +2 -7
  118. package/dist/src/components/app/icons/Jvm.js.map +1 -1
  119. package/dist/src/components/app/icons/Linux.d.ts +1 -1
  120. package/dist/src/components/app/icons/Linux.d.ts.map +1 -1
  121. package/dist/src/components/app/icons/Linux.js +2 -17
  122. package/dist/src/components/app/icons/Linux.js.map +1 -1
  123. package/dist/src/components/app/icons/MacOS.d.ts +1 -1
  124. package/dist/src/components/app/icons/MacOS.d.ts.map +1 -1
  125. package/dist/src/components/app/icons/MacOS.js +2 -3
  126. package/dist/src/components/app/icons/MacOS.js.map +1 -1
  127. package/dist/src/components/app/icons/NodeJs.d.ts +1 -1
  128. package/dist/src/components/app/icons/NodeJs.d.ts.map +1 -1
  129. package/dist/src/components/app/icons/NodeJs.js +2 -5
  130. package/dist/src/components/app/icons/NodeJs.js.map +1 -1
  131. package/dist/src/components/app/icons/Ruby.d.ts +1 -1
  132. package/dist/src/components/app/icons/Ruby.d.ts.map +1 -1
  133. package/dist/src/components/app/icons/Ruby.js +2 -3
  134. package/dist/src/components/app/icons/Ruby.js.map +1 -1
  135. package/dist/src/components/app/icons/Windows.d.ts +1 -1
  136. package/dist/src/components/app/icons/Windows.d.ts.map +1 -1
  137. package/dist/src/components/app/icons/Windows.js +2 -3
  138. package/dist/src/components/app/icons/Windows.js.map +1 -1
  139. package/dist/src/components/app/makeSetupString.d.ts +1 -1
  140. package/dist/src/components/app/makeSetupString.d.ts.map +1 -1
  141. package/dist/src/components/app/makeSetupString.js.map +1 -1
  142. package/dist/src/components/app/markdownComponents.d.ts +9 -0
  143. package/dist/src/components/app/markdownComponents.d.ts.map +1 -0
  144. package/dist/src/components/app/markdownComponents.js +6 -0
  145. package/dist/src/components/app/markdownComponents.js.map +1 -0
  146. package/dist/src/components/app/rehypePlugins.d.ts +2 -2
  147. package/dist/src/components/app/rehypePlugins.d.ts.map +1 -1
  148. package/dist/src/components/app/rehypePlugins.js.map +1 -1
  149. package/dist/src/components/app/remarkPlugins.d.ts +2 -2
  150. package/dist/src/components/app/remarkPlugins.d.ts.map +1 -1
  151. package/dist/src/components/app/remarkPlugins.js.map +1 -1
  152. package/dist/src/components/customise/CustomRendering.d.ts +18 -18
  153. package/dist/src/components/customise/CustomRendering.d.ts.map +1 -1
  154. package/dist/src/components/customise/CustomRendering.js +10 -9
  155. package/dist/src/components/customise/CustomRendering.js.map +1 -1
  156. package/dist/src/components/customise/CustomRendering.stories.scss +0 -17
  157. package/dist/src/components/gherkin/Anchor.d.ts +3 -3
  158. package/dist/src/components/gherkin/Anchor.d.ts.map +1 -1
  159. package/dist/src/components/gherkin/Anchor.js +3 -6
  160. package/dist/src/components/gherkin/Anchor.js.map +1 -1
  161. package/dist/src/components/gherkin/Background.d.ts +3 -3
  162. package/dist/src/components/gherkin/Background.d.ts.map +1 -1
  163. package/dist/src/components/gherkin/Background.js +4 -10
  164. package/dist/src/components/gherkin/Background.js.map +1 -1
  165. package/dist/src/components/gherkin/Children.d.ts +3 -3
  166. package/dist/src/components/gherkin/Children.d.ts.map +1 -1
  167. package/dist/src/components/gherkin/Children.js +3 -3
  168. package/dist/src/components/gherkin/Children.js.map +1 -1
  169. package/dist/src/components/gherkin/DataTable.d.ts +3 -3
  170. package/dist/src/components/gherkin/DataTable.d.ts.map +1 -1
  171. package/dist/src/components/gherkin/DataTable.js +4 -6
  172. package/dist/src/components/gherkin/DataTable.js.map +1 -1
  173. package/dist/src/components/gherkin/Description.d.ts +3 -3
  174. package/dist/src/components/gherkin/Description.d.ts.map +1 -1
  175. package/dist/src/components/gherkin/Description.js +3 -4
  176. package/dist/src/components/gherkin/Description.js.map +1 -1
  177. package/dist/src/components/gherkin/DocString.d.ts +3 -3
  178. package/dist/src/components/gherkin/DocString.d.ts.map +1 -1
  179. package/dist/src/components/gherkin/DocString.js +3 -4
  180. package/dist/src/components/gherkin/DocString.js.map +1 -1
  181. package/dist/src/components/gherkin/ErrorMessage.d.ts +2 -2
  182. package/dist/src/components/gherkin/ErrorMessage.d.ts.map +1 -1
  183. package/dist/src/components/gherkin/ErrorMessage.js +5 -3
  184. package/dist/src/components/gherkin/ErrorMessage.js.map +1 -1
  185. package/dist/src/components/gherkin/ErrorMessage.module.scss +17 -5
  186. package/dist/src/components/gherkin/Examples.d.ts +3 -3
  187. package/dist/src/components/gherkin/Examples.d.ts.map +1 -1
  188. package/dist/src/components/gherkin/Examples.js +7 -18
  189. package/dist/src/components/gherkin/Examples.js.map +1 -1
  190. package/dist/src/components/gherkin/Feature.d.ts +3 -3
  191. package/dist/src/components/gherkin/Feature.d.ts.map +1 -1
  192. package/dist/src/components/gherkin/Feature.js +14 -24
  193. package/dist/src/components/gherkin/Feature.js.map +1 -1
  194. package/dist/src/components/gherkin/GherkinDocument.d.ts +3 -3
  195. package/dist/src/components/gherkin/GherkinDocument.d.ts.map +1 -1
  196. package/dist/src/components/gherkin/GherkinDocument.js +3 -3
  197. package/dist/src/components/gherkin/GherkinDocument.js.map +1 -1
  198. package/dist/src/components/gherkin/Keyword.d.ts +2 -2
  199. package/dist/src/components/gherkin/Keyword.d.ts.map +1 -1
  200. package/dist/src/components/gherkin/Keyword.js +3 -3
  201. package/dist/src/components/gherkin/Keyword.js.map +1 -1
  202. package/dist/src/components/gherkin/Keyword.module.scss +0 -1
  203. package/dist/src/components/gherkin/Parameter.d.ts +3 -3
  204. package/dist/src/components/gherkin/Parameter.d.ts.map +1 -1
  205. package/dist/src/components/gherkin/Parameter.js +4 -4
  206. package/dist/src/components/gherkin/Parameter.js.map +1 -1
  207. package/dist/src/components/gherkin/Rule.d.ts +3 -3
  208. package/dist/src/components/gherkin/Rule.d.ts.map +1 -1
  209. package/dist/src/components/gherkin/Rule.js +11 -21
  210. package/dist/src/components/gherkin/Rule.js.map +1 -1
  211. package/dist/src/components/gherkin/Scenario.d.ts +3 -3
  212. package/dist/src/components/gherkin/Scenario.d.ts.map +1 -1
  213. package/dist/src/components/gherkin/Scenario.js +5 -14
  214. package/dist/src/components/gherkin/Scenario.js.map +1 -1
  215. package/dist/src/components/gherkin/StatusIcon.d.ts +2 -2
  216. package/dist/src/components/gherkin/StatusIcon.d.ts.map +1 -1
  217. package/dist/src/components/gherkin/StatusIcon.js +10 -10
  218. package/dist/src/components/gherkin/StatusIcon.js.map +1 -1
  219. package/dist/src/components/gherkin/StepsList.d.ts +1 -1
  220. package/dist/src/components/gherkin/StepsList.d.ts.map +1 -1
  221. package/dist/src/components/gherkin/StepsList.js +2 -2
  222. package/dist/src/components/gherkin/StepsList.js.map +1 -1
  223. package/dist/src/components/gherkin/Tags.d.ts +3 -3
  224. package/dist/src/components/gherkin/Tags.d.ts.map +1 -1
  225. package/dist/src/components/gherkin/Tags.js +4 -5
  226. package/dist/src/components/gherkin/Tags.js.map +1 -1
  227. package/dist/src/components/gherkin/Title.d.ts +3 -3
  228. package/dist/src/components/gherkin/Title.d.ts.map +1 -1
  229. package/dist/src/components/gherkin/Title.js +3 -4
  230. package/dist/src/components/gherkin/Title.js.map +1 -1
  231. package/dist/src/components/gherkin/attachment/Attachment.d.ts +3 -3
  232. package/dist/src/components/gherkin/attachment/Attachment.d.ts.map +1 -1
  233. package/dist/src/components/gherkin/attachment/Attachment.js +14 -17
  234. package/dist/src/components/gherkin/attachment/Attachment.js.map +1 -1
  235. package/dist/src/components/gherkin/attachment/Attachment.module.scss +15 -5
  236. package/dist/src/components/gherkin/attachment/Image.d.ts +4 -4
  237. package/dist/src/components/gherkin/attachment/Image.d.ts.map +1 -1
  238. package/dist/src/components/gherkin/attachment/Image.js +6 -8
  239. package/dist/src/components/gherkin/attachment/Image.js.map +1 -1
  240. package/dist/src/components/gherkin/attachment/Links.d.ts +3 -3
  241. package/dist/src/components/gherkin/attachment/Links.d.ts.map +1 -1
  242. package/dist/src/components/gherkin/attachment/Links.js +7 -10
  243. package/dist/src/components/gherkin/attachment/Links.js.map +1 -1
  244. package/dist/src/components/gherkin/attachment/Log.d.ts +3 -3
  245. package/dist/src/components/gherkin/attachment/Log.d.ts.map +1 -1
  246. package/dist/src/components/gherkin/attachment/Log.js +3 -3
  247. package/dist/src/components/gherkin/attachment/Log.js.map +1 -1
  248. package/dist/src/components/gherkin/attachment/Text.d.ts +3 -3
  249. package/dist/src/components/gherkin/attachment/Text.d.ts.map +1 -1
  250. package/dist/src/components/gherkin/attachment/Text.js +4 -6
  251. package/dist/src/components/gherkin/attachment/Text.js.map +1 -1
  252. package/dist/src/components/gherkin/attachment/Unknown.d.ts +2 -2
  253. package/dist/src/components/gherkin/attachment/Unknown.d.ts.map +1 -1
  254. package/dist/src/components/gherkin/attachment/Unknown.js +9 -17
  255. package/dist/src/components/gherkin/attachment/Unknown.js.map +1 -1
  256. package/dist/src/components/gherkin/attachment/Video.d.ts +3 -3
  257. package/dist/src/components/gherkin/attachment/Video.d.ts.map +1 -1
  258. package/dist/src/components/gherkin/attachment/Video.js +6 -10
  259. package/dist/src/components/gherkin/attachment/Video.js.map +1 -1
  260. package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts +1 -1
  261. package/dist/src/components/gherkin/attachment/attachmentFilename.d.ts.map +1 -1
  262. package/dist/src/components/gherkin/attachment/attachmentFilename.js.map +1 -1
  263. package/dist/src/components/gherkin/attachment/base64Decode.d.ts +9 -1
  264. package/dist/src/components/gherkin/attachment/base64Decode.d.ts.map +1 -1
  265. package/dist/src/components/gherkin/attachment/base64Decode.js +17 -3
  266. package/dist/src/components/gherkin/attachment/base64Decode.js.map +1 -1
  267. package/dist/src/components/gherkin/attachment/useText.d.ts +1 -1
  268. package/dist/src/components/gherkin/attachment/useText.d.ts.map +1 -1
  269. package/dist/src/components/gherkin/attachment/useText.js +3 -3
  270. package/dist/src/components/gherkin/attachment/useText.js.map +1 -1
  271. package/dist/src/components/gherkin/composeHookStepTitle.d.ts +1 -1
  272. package/dist/src/components/gherkin/composeHookStepTitle.d.ts.map +1 -1
  273. package/dist/src/components/gherkin/composeHookStepTitle.js +1 -1
  274. package/dist/src/components/gherkin/composeHookStepTitle.js.map +1 -1
  275. package/dist/src/components/gherkin/composePickleStepTitle.d.ts +1 -1
  276. package/dist/src/components/gherkin/composePickleStepTitle.d.ts.map +1 -1
  277. package/dist/src/components/gherkin/composePickleStepTitle.js +2 -2
  278. package/dist/src/components/gherkin/composePickleStepTitle.js.map +1 -1
  279. package/dist/src/components/gherkin/statusName.d.ts +2 -2
  280. package/dist/src/components/gherkin/statusName.d.ts.map +1 -1
  281. package/dist/src/components/gherkin/statusName.js.map +1 -1
  282. package/dist/src/components/results/AmbiguousResult.d.ts +8 -0
  283. package/dist/src/components/results/AmbiguousResult.d.ts.map +1 -0
  284. package/dist/src/components/results/AmbiguousResult.js +11 -0
  285. package/dist/src/components/results/AmbiguousResult.js.map +1 -0
  286. package/dist/src/components/results/AmbiguousResult.module.scss +22 -0
  287. package/dist/src/components/results/FailedResult.d.ts +8 -0
  288. package/dist/src/components/results/FailedResult.d.ts.map +1 -0
  289. package/dist/src/components/results/FailedResult.js +15 -0
  290. package/dist/src/components/results/FailedResult.js.map +1 -0
  291. package/dist/src/components/results/PendingResult.d.ts +8 -0
  292. package/dist/src/components/results/PendingResult.d.ts.map +1 -0
  293. package/dist/src/components/results/PendingResult.js +12 -0
  294. package/dist/src/components/results/PendingResult.js.map +1 -0
  295. package/dist/src/components/results/ResultNote.d.ts +3 -0
  296. package/dist/src/components/results/ResultNote.d.ts.map +1 -0
  297. package/dist/src/components/results/ResultNote.js +6 -0
  298. package/dist/src/components/results/ResultNote.js.map +1 -0
  299. package/dist/src/components/results/ResultNote.module.scss +6 -0
  300. package/dist/src/components/results/SkippedResult.d.ts +8 -0
  301. package/dist/src/components/results/SkippedResult.d.ts.map +1 -0
  302. package/dist/src/components/results/SkippedResult.js +12 -0
  303. package/dist/src/components/results/SkippedResult.js.map +1 -0
  304. package/dist/src/components/results/SourceReference.d.ts +8 -0
  305. package/dist/src/components/results/SourceReference.d.ts.map +1 -0
  306. package/dist/src/components/results/SourceReference.js +13 -0
  307. package/dist/src/components/results/SourceReference.js.map +1 -0
  308. package/dist/src/components/results/SourceReference.module.scss +10 -0
  309. package/dist/src/components/results/TestCaseOutcome.d.ts +2 -2
  310. package/dist/src/components/results/TestCaseOutcome.d.ts.map +1 -1
  311. package/dist/src/components/results/TestCaseOutcome.js +5 -9
  312. package/dist/src/components/results/TestCaseOutcome.js.map +1 -1
  313. package/dist/src/components/results/TestRunHookOutcome.d.ts +2 -2
  314. package/dist/src/components/results/TestRunHookOutcome.d.ts.map +1 -1
  315. package/dist/src/components/results/TestRunHookOutcome.js +4 -13
  316. package/dist/src/components/results/TestRunHookOutcome.js.map +1 -1
  317. package/dist/src/components/results/TestStepAttachments.d.ts +2 -2
  318. package/dist/src/components/results/TestStepAttachments.d.ts.map +1 -1
  319. package/dist/src/components/results/TestStepAttachments.js +4 -5
  320. package/dist/src/components/results/TestStepAttachments.js.map +1 -1
  321. package/dist/src/components/results/TestStepDuration.d.ts +2 -2
  322. package/dist/src/components/results/TestStepDuration.d.ts.map +1 -1
  323. package/dist/src/components/results/TestStepDuration.js +4 -2
  324. package/dist/src/components/results/TestStepDuration.js.map +1 -1
  325. package/dist/src/components/results/TestStepOutcome.d.ts +2 -2
  326. package/dist/src/components/results/TestStepOutcome.d.ts.map +1 -1
  327. package/dist/src/components/results/TestStepOutcome.js +18 -27
  328. package/dist/src/components/results/TestStepOutcome.js.map +1 -1
  329. package/dist/src/components/results/TestStepOutcome.module.scss +1 -1
  330. package/dist/src/components/results/UndefinedResult.d.ts +8 -0
  331. package/dist/src/components/results/UndefinedResult.d.ts.map +1 -0
  332. package/dist/src/components/results/UndefinedResult.js +18 -0
  333. package/dist/src/components/results/UndefinedResult.js.map +1 -0
  334. package/dist/src/components/results/UndefinedResult.module.scss +14 -0
  335. package/dist/src/components/results/index.d.ts +1 -1
  336. package/dist/src/components/results/index.d.ts.map +1 -1
  337. package/dist/src/components/results/index.js +1 -1
  338. package/dist/src/components/results/index.js.map +1 -1
  339. package/dist/src/formatExecutionDuration.js.map +1 -1
  340. package/dist/src/hooks/helpers.js.map +1 -1
  341. package/dist/src/hooks/useFilteredDocuments.d.ts +2 -2
  342. package/dist/src/hooks/useFilteredDocuments.d.ts.map +1 -1
  343. package/dist/src/hooks/useFilteredDocuments.js +70 -34
  344. package/dist/src/hooks/useFilteredDocuments.js.map +1 -1
  345. package/dist/src/hooks/useMostSevereStatusByUri.js.map +1 -1
  346. package/dist/src/hooks/useQueries.d.ts +2 -2
  347. package/dist/src/hooks/useQueries.d.ts.map +1 -1
  348. package/dist/src/hooks/useQueries.js.map +1 -1
  349. package/dist/src/hooks/useResultStatistics.d.ts +1 -1
  350. package/dist/src/hooks/useResultStatistics.d.ts.map +1 -1
  351. package/dist/src/hooks/useResultStatistics.js.map +1 -1
  352. package/dist/src/hooks/useSearch.d.ts +1 -1
  353. package/dist/src/hooks/useSearch.d.ts.map +1 -1
  354. package/dist/src/hooks/useSearch.js.map +1 -1
  355. package/dist/src/hooks/useTestCaseStarted.d.ts +6 -1
  356. package/dist/src/hooks/useTestCaseStarted.d.ts.map +1 -1
  357. package/dist/src/hooks/useTestCaseStarted.js +13 -10
  358. package/dist/src/hooks/useTestCaseStarted.js.map +1 -1
  359. package/dist/src/hooks/useTestRunHooks.d.ts +1 -1
  360. package/dist/src/hooks/useTestRunHooks.d.ts.map +1 -1
  361. package/dist/src/hooks/useTestRunHooks.js.map +1 -1
  362. package/dist/src/search/FeatureSearch.d.ts +12 -3
  363. package/dist/src/search/FeatureSearch.d.ts.map +1 -1
  364. package/dist/src/search/FeatureSearch.js +9 -17
  365. package/dist/src/search/FeatureSearch.js.map +1 -1
  366. package/dist/src/search/ScenarioLikeSearch.d.ts +8 -13
  367. package/dist/src/search/ScenarioLikeSearch.d.ts.map +1 -1
  368. package/dist/src/search/ScenarioLikeSearch.js +13 -17
  369. package/dist/src/search/ScenarioLikeSearch.js.map +1 -1
  370. package/dist/src/search/StepSearch.d.ts +9 -16
  371. package/dist/src/search/StepSearch.d.ts.map +1 -1
  372. package/dist/src/search/StepSearch.js +13 -17
  373. package/dist/src/search/StepSearch.js.map +1 -1
  374. package/dist/src/search/TextSearch.d.ts +11 -2
  375. package/dist/src/search/TextSearch.d.ts.map +1 -1
  376. package/dist/src/search/TextSearch.js +59 -52
  377. package/dist/src/search/TextSearch.js.map +1 -1
  378. package/dist/src/search/createSearchIndex.d.ts +7 -0
  379. package/dist/src/search/createSearchIndex.d.ts.map +1 -0
  380. package/dist/src/search/createSearchIndex.js +10 -0
  381. package/dist/src/search/createSearchIndex.js.map +1 -0
  382. package/dist/src/search/deriveLineageConstraints.d.ts +8 -0
  383. package/dist/src/search/deriveLineageConstraints.d.ts.map +1 -0
  384. package/dist/src/search/deriveLineageConstraints.js +38 -0
  385. package/dist/src/search/deriveLineageConstraints.js.map +1 -0
  386. package/dist/src/search/index.d.ts +3 -1
  387. package/dist/src/search/index.d.ts.map +1 -1
  388. package/dist/src/search/index.js +3 -1
  389. package/dist/src/search/index.js.map +1 -1
  390. package/dist/src/search/pruneGherkinDocuments.d.ts +24 -0
  391. package/dist/src/search/pruneGherkinDocuments.d.ts.map +1 -0
  392. package/dist/src/search/pruneGherkinDocuments.js +180 -0
  393. package/dist/src/search/pruneGherkinDocuments.js.map +1 -0
  394. package/dist/src/search/types.d.ts +39 -8
  395. package/dist/src/search/types.d.ts.map +1 -1
  396. package/dist/src/search/types.js +1 -1
  397. package/dist/src/search/types.js.map +1 -1
  398. package/dist/src/toRepositoryId.d.ts +1 -1
  399. package/dist/src/toRepositoryId.d.ts.map +1 -1
  400. package/dist/src/toRepositoryId.js +7 -6
  401. package/dist/src/toRepositoryId.js.map +1 -1
  402. package/dist/tsconfig.build.tsbuildinfo +1 -1
  403. package/package.json +56 -69
  404. package/dist/src/components/results/TestStepResultDetails.d.ts +0 -4
  405. package/dist/src/components/results/TestStepResultDetails.d.ts.map +0 -1
  406. package/dist/src/components/results/TestStepResultDetails.js +0 -16
  407. package/dist/src/components/results/TestStepResultDetails.js.map +0 -1
  408. package/dist/src/search/Search.d.ts +0 -11
  409. package/dist/src/search/Search.d.ts.map +0 -1
  410. package/dist/src/search/Search.js +0 -51
  411. package/dist/src/search/Search.js.map +0 -1
  412. package/dist/src/search/TagSearch.d.ts +0 -4
  413. package/dist/src/search/TagSearch.d.ts.map +0 -1
  414. package/dist/src/search/TagSearch.js +0 -57
  415. package/dist/src/search/TagSearch.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TestStepOutcome.d.ts","sourceRoot":"","sources":["../../../../src/components/results/TestStepOutcome.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAWjC,UAAU,KAAK;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,KAAK,CAsBrC,CAAA"}
1
+ {"version":3,"file":"TestStepOutcome.d.ts","sourceRoot":"","sources":["../../../../src/components/results/TestStepOutcome.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EAEtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAe/B,UAAU,KAAK;IACb,QAAQ,EAAE,QAAQ,CAAA;IAClB,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,KAAK,CAoCrC,CAAA"}
@@ -1,53 +1,44 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { TestStepResultStatus, } from '@cucumber/messages';
2
3
  import { useQueries } from '../../hooks/index.js';
3
4
  import { composeHookStepTitle } from '../gherkin/composeHookStepTitle.js';
4
5
  import { composePickleStepTitle } from '../gherkin/composePickleStepTitle.js';
5
6
  import { DataTable, DocString, Keyword, Parameter, StatusIcon } from '../gherkin/index.js';
7
+ import { AmbiguousResult } from './AmbiguousResult.js';
8
+ import { FailedResult } from './FailedResult.js';
9
+ import { PendingResult } from './PendingResult.js';
10
+ import { SkippedResult } from './SkippedResult.js';
6
11
  import { TestStepAttachments } from './TestStepAttachments.js';
7
12
  import { TestStepDuration } from './TestStepDuration.js';
8
13
  import styles from './TestStepOutcome.module.scss';
9
- import { TestStepResultDetails } from './TestStepResultDetails.js';
14
+ import { UndefinedResult } from './UndefinedResult.js';
10
15
  export const TestStepOutcome = ({ testStep, testStepFinished }) => {
11
- return (React.createElement("li", { "data-status": testStepFinished.testStepResult.status },
12
- React.createElement("div", { className: styles.header },
13
- React.createElement("div", { className: styles.status },
14
- React.createElement(StatusIcon, { status: testStepFinished.testStepResult.status })),
15
- React.createElement("div", { className: styles.title },
16
- React.createElement("h3", { className: styles.name },
17
- testStep.hookId && React.createElement(HookStepTitle, { testStep: testStep }),
18
- testStep.pickleStepId && React.createElement(PickleStepTitle, { testStep: testStep })),
19
- React.createElement(TestStepDuration, { duration: testStepFinished.testStepResult.duration }))),
20
- React.createElement("div", { className: styles.content },
21
- testStep.pickleStepId && React.createElement(PickleStepArgument, { testStep: testStep }),
22
- React.createElement(TestStepResultDetails, { ...testStepFinished.testStepResult }),
23
- React.createElement(TestStepAttachments, { testStepOrHookFinished: testStepFinished }))));
16
+ return (_jsxs("li", { "data-status": testStepFinished.testStepResult.status, children: [_jsxs("div", { className: styles.header, children: [_jsx("div", { className: styles.status, children: _jsx(StatusIcon, { status: testStepFinished.testStepResult.status }) }), _jsxs("div", { className: styles.title, children: [_jsxs("h3", { className: styles.name, children: [testStep.hookId && _jsx(HookStepTitle, { testStep: testStep }), testStep.pickleStepId && _jsx(PickleStepTitle, { testStep: testStep })] }), _jsx(TestStepDuration, { duration: testStepFinished.testStepResult.duration })] })] }), _jsxs("div", { className: styles.content, children: [testStep.pickleStepId && _jsx(PickleStepArgument, { testStep: testStep }), testStepFinished.testStepResult.status === TestStepResultStatus.AMBIGUOUS && (_jsx(AmbiguousResult, { testStep: testStep })), testStepFinished.testStepResult.status === TestStepResultStatus.FAILED && (_jsx(FailedResult, { result: testStepFinished.testStepResult })), testStepFinished.testStepResult.status === TestStepResultStatus.PENDING && (_jsx(PendingResult, { result: testStepFinished.testStepResult })), testStepFinished.testStepResult.status === TestStepResultStatus.SKIPPED && (_jsx(SkippedResult, { result: testStepFinished.testStepResult })), testStepFinished.testStepResult.status === TestStepResultStatus.UNDEFINED && (_jsx(UndefinedResult, { testStep: testStep })), _jsx(TestStepAttachments, { testStepOrHookFinished: testStepFinished })] })] }));
24
17
  };
25
18
  const HookStepTitle = ({ testStep }) => {
26
19
  const { cucumberQuery } = useQueries();
27
20
  const hook = cucumberQuery.findHookBy(testStep);
28
- return React.createElement(React.Fragment, null, composeHookStepTitle(hook));
21
+ return _jsx(_Fragment, { children: composeHookStepTitle(hook) });
29
22
  };
30
23
  const PickleStepTitle = ({ testStep }) => {
31
24
  const { cucumberQuery } = useQueries();
32
25
  const pickleStep = cucumberQuery.findPickleStepBy(testStep);
33
26
  const step = cucumberQuery.findStepBy(pickleStep);
34
- return (React.createElement(React.Fragment, null,
35
- React.createElement(Keyword, null, step?.keyword?.trim()),
36
- composePickleStepTitle(pickleStep.text, testStep.stepMatchArgumentsLists).map((fragment, index) => {
37
- if (fragment.parameterTypeName) {
38
- return (React.createElement(Parameter, { key: index, parameterTypeName: fragment.parameterTypeName, value: fragment.value }, fragment.value));
39
- }
40
- return React.createElement("span", { key: index }, fragment.value);
41
- })));
27
+ return (_jsxs(_Fragment, { children: [_jsx(Keyword, { children: step?.keyword?.trim() }), composePickleStepTitle(pickleStep.text, testStep.stepMatchArgumentsLists).map((fragment, index) => {
28
+ if (fragment.parameterTypeName) {
29
+ return (_jsx(Parameter, { value: fragment.value, parameterTypeName: fragment.parameterTypeName, children: fragment.value }, index));
30
+ }
31
+ return _jsx("span", { children: fragment.value }, index);
32
+ })] }));
42
33
  };
43
34
  const PickleStepArgument = ({ testStep }) => {
44
35
  const { cucumberQuery } = useQueries();
45
36
  const pickleStep = cucumberQuery.findPickleStepBy(testStep);
46
37
  if (pickleStep.argument?.docString) {
47
- return React.createElement(DocString, { docString: pickleStep.argument.docString });
38
+ return _jsx(DocString, { docString: pickleStep.argument.docString });
48
39
  }
49
- else if (pickleStep.argument?.dataTable) {
50
- return React.createElement(DataTable, { dataTable: pickleStep.argument.dataTable });
40
+ if (pickleStep.argument?.dataTable) {
41
+ return _jsx(DataTable, { dataTable: pickleStep.argument.dataTable });
51
42
  }
52
43
  return null;
53
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TestStepOutcome.js","sourceRoot":"","sources":["../../../../src/components/results/TestStepOutcome.tsx"],"names":[],"mappings":"AACA,OAAO,KAAa,MAAM,OAAO,CAAA;A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;AAED,MAAM,kBAAkB,GAA+B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtE,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,UAAU,GAAG,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAe,CAAA;IACzE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE;QAClC,OAAO,oBAAC,SAAS,IAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,GAAI,CAAA;KAC/D;SAAM,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE;QACzC,OAAO,oBAAC,SAAS,IAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,SAAS,GAAI,CAAA;KAC/D;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA","sourcesContent":["import { PickleStep, TestStep, TestStepFinished } from '@cucumber/messages'\nimport React, { FC } from 'react'\n\nimport { useQueries } from '../../hooks/index.js'\nimport { composeHookStepTitle } from '../gherkin/composeHookStepTitle.js'\nimport { composePickleStepTitle } from '../gherkin/composePickleStepTitle.js'\nimport { DataTable, DocString, Keyword, Parameter, StatusIcon } from '../gherkin/index.js'\nimport { TestStepAttachments } from './TestStepAttachments.js'\nimport { TestStepDuration } from './TestStepDuration.js'\nimport styles from './TestStepOutcome.module.scss'\nimport { TestStepResultDetails } from './TestStepResultDetails.js'\n\ninterface Props {\n testStep: TestStep\n testStepFinished: TestStepFinished\n}\n\nexport const TestStepOutcome: FC<Props> = ({ testStep, testStepFinished }) => {\n return (\n <li data-status={testStepFinished.testStepResult.status}>\n <div className={styles.header}>\n <div className={styles.status}>\n <StatusIcon status={testStepFinished.testStepResult.status} />\n </div>\n <div className={styles.title}>\n <h3 className={styles.name}>\n {testStep.hookId && <HookStepTitle testStep={testStep} />}\n {testStep.pickleStepId && <PickleStepTitle testStep={testStep} />}\n </h3>\n <TestStepDuration duration={testStepFinished.testStepResult.duration} />\n </div>\n </div>\n <div className={styles.content}>\n {testStep.pickleStepId && <PickleStepArgument testStep={testStep} />}\n <TestStepResultDetails {...testStepFinished.testStepResult} />\n <TestStepAttachments testStepOrHookFinished={testStepFinished} />\n </div>\n </li>\n )\n}\n\nconst HookStepTitle: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const hook = cucumberQuery.findHookBy(testStep)\n return <>{composeHookStepTitle(hook)}</>\n}\n\nconst PickleStepTitle: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const pickleStep = cucumberQuery.findPickleStepBy(testStep) as PickleStep\n const step = cucumberQuery.findStepBy(pickleStep)\n return (\n <>\n <Keyword>{step?.keyword?.trim()}</Keyword>\n {composePickleStepTitle(pickleStep.text, testStep.stepMatchArgumentsLists).map(\n (fragment, index) => {\n if (fragment.parameterTypeName) {\n return (\n <Parameter\n key={index}\n parameterTypeName={fragment.parameterTypeName}\n value={fragment.value}\n >\n {fragment.value}\n </Parameter>\n )\n }\n return <span key={index}>{fragment.value}</span>\n }\n )}\n </>\n )\n}\n\nconst PickleStepArgument: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const pickleStep = cucumberQuery.findPickleStepBy(testStep) as PickleStep\n if (pickleStep.argument?.docString) {\n return <DocString docString={pickleStep.argument.docString} />\n } else if (pickleStep.argument?.dataTable) {\n return <DataTable dataTable={pickleStep.argument.dataTable} />\n }\n return null\n}\n"]}
1
+ {"version":3,"file":"TestStepOutcome.js","sourceRoot":"","sources":["../../../../src/components/results/TestStepOutcome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAE,S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port type { FC } from 'react'\n\nimport { useQueries } from '../../hooks/index.js'\nimport { composeHookStepTitle } from '../gherkin/composeHookStepTitle.js'\nimport { composePickleStepTitle } from '../gherkin/composePickleStepTitle.js'\nimport { DataTable, DocString, Keyword, Parameter, StatusIcon } from '../gherkin/index.js'\nimport { AmbiguousResult } from './AmbiguousResult.js'\nimport { FailedResult } from './FailedResult.js'\nimport { PendingResult } from './PendingResult.js'\nimport { SkippedResult } from './SkippedResult.js'\nimport { TestStepAttachments } from './TestStepAttachments.js'\nimport { TestStepDuration } from './TestStepDuration.js'\nimport styles from './TestStepOutcome.module.scss'\nimport { UndefinedResult } from './UndefinedResult.js'\n\ninterface Props {\n testStep: TestStep\n testStepFinished: TestStepFinished\n}\n\nexport const TestStepOutcome: FC<Props> = ({ testStep, testStepFinished }) => {\n return (\n <li data-status={testStepFinished.testStepResult.status}>\n <div className={styles.header}>\n <div className={styles.status}>\n <StatusIcon status={testStepFinished.testStepResult.status} />\n </div>\n <div className={styles.title}>\n <h3 className={styles.name}>\n {testStep.hookId && <HookStepTitle testStep={testStep} />}\n {testStep.pickleStepId && <PickleStepTitle testStep={testStep} />}\n </h3>\n <TestStepDuration duration={testStepFinished.testStepResult.duration} />\n </div>\n </div>\n <div className={styles.content}>\n {testStep.pickleStepId && <PickleStepArgument testStep={testStep} />}\n {testStepFinished.testStepResult.status === TestStepResultStatus.AMBIGUOUS && (\n <AmbiguousResult testStep={testStep} />\n )}\n {testStepFinished.testStepResult.status === TestStepResultStatus.FAILED && (\n <FailedResult result={testStepFinished.testStepResult} />\n )}\n {testStepFinished.testStepResult.status === TestStepResultStatus.PENDING && (\n <PendingResult result={testStepFinished.testStepResult} />\n )}\n {testStepFinished.testStepResult.status === TestStepResultStatus.SKIPPED && (\n <SkippedResult result={testStepFinished.testStepResult} />\n )}\n {testStepFinished.testStepResult.status === TestStepResultStatus.UNDEFINED && (\n <UndefinedResult testStep={testStep} />\n )}\n <TestStepAttachments testStepOrHookFinished={testStepFinished} />\n </div>\n </li>\n )\n}\n\nconst HookStepTitle: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const hook = cucumberQuery.findHookBy(testStep)\n return <>{composeHookStepTitle(hook)}</>\n}\n\nconst PickleStepTitle: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const pickleStep = cucumberQuery.findPickleStepBy(testStep) as PickleStep\n const step = cucumberQuery.findStepBy(pickleStep)\n return (\n <>\n <Keyword>{step?.keyword?.trim()}</Keyword>\n {composePickleStepTitle(pickleStep.text, testStep.stepMatchArgumentsLists).map(\n (fragment, index) => {\n if (fragment.parameterTypeName) {\n return (\n <Parameter\n key={index}\n value={fragment.value}\n parameterTypeName={fragment.parameterTypeName}\n >\n {fragment.value}\n </Parameter>\n )\n }\n return <span key={index}>{fragment.value}</span>\n }\n )}\n </>\n )\n}\n\nconst PickleStepArgument: FC<{ testStep: TestStep }> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const pickleStep = cucumberQuery.findPickleStepBy(testStep) as PickleStep\n if (pickleStep.argument?.docString) {\n return <DocString docString={pickleStep.argument.docString} />\n }\n if (pickleStep.argument?.dataTable) {\n return <DataTable dataTable={pickleStep.argument.dataTable} />\n }\n return null\n}\n"]}
@@ -27,7 +27,7 @@
27
27
  }
28
28
 
29
29
  .content {
30
- margin-left: 1.125rem;
30
+ margin-left: 1.375rem;
31
31
 
32
32
  // bits of detail (doc string, data table, error, attachments) get consistent spacing between them
33
33
  > * {
@@ -0,0 +1,8 @@
1
+ import type { TestStep } from '@cucumber/messages';
2
+ import type { FC } from 'react';
3
+ interface Props {
4
+ testStep: TestStep;
5
+ }
6
+ export declare const UndefinedResult: FC<Props>;
7
+ export {};
8
+ //# sourceMappingURL=UndefinedResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UndefinedResult.d.ts","sourceRoot":"","sources":["../../../../src/components/results/UndefinedResult.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAO/B,UAAU,KAAK;IACb,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,KAAK,CAqBrC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ensure } from '../../hooks/helpers.js';
3
+ import { useQueries } from '../../hooks/index.js';
4
+ import { ResultNote } from './ResultNote.js';
5
+ import styles from './UndefinedResult.module.scss';
6
+ export const UndefinedResult = ({ testStep }) => {
7
+ const { cucumberQuery } = useQueries();
8
+ const pickleStep = ensure(cucumberQuery.findPickleStepBy(testStep), 'Expected TestStep with UNDEFINED status to have a PickleStep');
9
+ const snippets = cucumberQuery
10
+ .findSuggestionsBy(pickleStep)
11
+ .flatMap((suggestion) => suggestion.snippets);
12
+ if (snippets.length === 0) {
13
+ return _jsx(ResultNote, { children: "No step definition found." });
14
+ }
15
+ const concatenatedCode = snippets.map((snippet) => snippet.code).join('\n\n');
16
+ return (_jsxs(_Fragment, { children: [_jsx(ResultNote, { children: "No step definition found. Implement with the snippet(s) below:" }), _jsx("pre", { className: styles.snippets, children: _jsx("code", { children: concatenatedCode }) })] }));
17
+ };
18
+ //# sourceMappingURL=UndefinedResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UndefinedResult.js","sourceRoot":"","sources":["../../../../src/components/results/UndefinedResult.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAMlD,MAAM,CAAC,MAAM,eAAe,GAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzD,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,UAAU,GAAG,MAAM,CACvB,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACxC,8DAA8D,CAC/D,CAAA;IACD,MAAM,QAAQ,GAAG,aAAa;SAC3B,iBAAiB,CAAC,UAAU,CAAC;SAC7B,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC/C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAC,UAAU,4CAAuC,CAAA;IAC3D,CAAC;IACD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7E,OAAO,CACL,8BACE,KAAC,UAAU,iFAA4E,EACvF,cAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,YAC7B,yBAAO,gBAAgB,GAAQ,GAC3B,IACL,CACJ,CAAA;AACH,CAAC,CAAA","sourcesContent":["import type { TestStep } from '@cucumber/messages'\nimport type { FC } from 'react'\n\nimport { ensure } from '../../hooks/helpers.js'\nimport { useQueries } from '../../hooks/index.js'\nimport { ResultNote } from './ResultNote.js'\nimport styles from './UndefinedResult.module.scss'\n\ninterface Props {\n testStep: TestStep\n}\n\nexport const UndefinedResult: FC<Props> = ({ testStep }) => {\n const { cucumberQuery } = useQueries()\n const pickleStep = ensure(\n cucumberQuery.findPickleStepBy(testStep),\n 'Expected TestStep with UNDEFINED status to have a PickleStep'\n )\n const snippets = cucumberQuery\n .findSuggestionsBy(pickleStep)\n .flatMap((suggestion) => suggestion.snippets)\n if (snippets.length === 0) {\n return <ResultNote>No step definition found.</ResultNote>\n }\n const concatenatedCode = snippets.map((snippet) => snippet.code).join('\\n\\n')\n return (\n <>\n <ResultNote>No step definition found. Implement with the snippet(s) below:</ResultNote>\n <pre className={styles.snippets}>\n <code>{concatenatedCode}</code>\n </pre>\n </>\n )\n}\n"]}
@@ -0,0 +1,14 @@
1
+ @use '../../styles/theming';
2
+
3
+ .snippets {
4
+ position: relative;
5
+ white-space: pre-wrap;
6
+ width: fit-content;
7
+ font-size: 0.875em;
8
+ padding: 0.666em 0.75em;
9
+ border-radius: 0.25em;
10
+ margin: 0;
11
+ overflow-x: auto;
12
+ background-color: theming.$codeBackgroundColor;
13
+ color: theming.$codeTextColor;
14
+ }
@@ -1,3 +1,3 @@
1
+ export * from './FailedResult.js';
1
2
  export * from './TestCaseOutcome.js';
2
- export * from './TestStepResultDetails.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA"}
@@ -1,3 +1,3 @@
1
+ export * from './FailedResult.js';
1
2
  export * from './TestCaseOutcome.js';
2
- export * from './TestStepResultDetails.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA","sourcesContent":["export * from './TestCaseOutcome.js'\nexport * from './TestStepResultDetails.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/results/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA","sourcesContent":["export * from './FailedResult.js'\nexport * from './TestCaseOutcome.js'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"formatExecutionDuration.js","sourceRoot":"","sources":["../../src/formatExecutionDuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE7D,MAAM,UAAU,uBAAuB,CAAC,SAAe,EAAE,UAAgB;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAA;IAC5D,0DAA0D;IAC1D,IAAI,SAAS,GAAG,KAAK,EAAE;QACrB,OAAO,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;YACzC,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAA;KACtC;IACD,OAAO,cAAc,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AACtF,CAAC","sourcesContent":["import { formatDuration, intervalToDuration } from 'date-fns'\n\nexport function formatExecutionDuration(startDate: Date, finishDate: Date) {\n const inMilllis = finishDate.getTime() - startDate.getTime()\n // if under 10s, use 0.01s precision, otherwise 1s is fine\n if (inMilllis < 10000) {\n return `${new Intl.NumberFormat(undefined, {\n maximumFractionDigits: 2,\n }).format(inMilllis / 1000)} seconds`\n }\n return formatDuration(intervalToDuration({ start: startDate, end: finishDate }), {})\n}\n"]}
1
+ {"version":3,"file":"formatExecutionDuration.js","sourceRoot":"","sources":["../../src/formatExecutionDuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE7D,MAAM,UAAU,uBAAuB,CAAC,SAAe,EAAE,UAAgB;IACvE,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAA;IAC5D,0DAA0D;IAC1D,IAAI,SAAS,GAAG,KAAK,EAAE,CAAC;QACtB,OAAO,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;YACzC,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAA;IACvC,CAAC;IACD,OAAO,cAAc,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AACtF,CAAC","sourcesContent":["import { formatDuration, intervalToDuration } from 'date-fns'\n\nexport function formatExecutionDuration(startDate: Date, finishDate: Date) {\n const inMilllis = finishDate.getTime() - startDate.getTime()\n // if under 10s, use 0.01s precision, otherwise 1s is fine\n if (inMilllis < 10000) {\n return `${new Intl.NumberFormat(undefined, {\n maximumFractionDigits: 2,\n }).format(inMilllis / 1000)} seconds`\n }\n return formatDuration(intervalToDuration({ start: startDate, end: finishDate }), {})\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/hooks/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAI,KAAoB,EAAE,OAAe;IAC7D,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;KACzB;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["export function ensure<T>(value: T | undefined, message: string): T {\n if (!value) {\n throw new Error(message)\n }\n return value\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/hooks/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAI,KAAoB,EAAE,OAAe;IAC7D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["export function ensure<T>(value: T | undefined, message: string): T {\n if (!value) {\n throw new Error(message)\n }\n return value\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { GherkinDocument } from '@cucumber/messages';
1
+ import { type GherkinDocument } from '@cucumber/messages';
2
2
  export declare function useFilteredDocuments(): {
3
- results: GherkinDocument[] | undefined;
3
+ results?: ReadonlyArray<GherkinDocument>;
4
4
  filtered: boolean;
5
5
  };
6
6
  //# sourceMappingURL=useFilteredDocuments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFilteredDocuments.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFilteredDocuments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAA;AAQ1E,wBAAgB,oBAAoB,IAAI;IACtC,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS,CAAA;IACtC,QAAQ,EAAE,OAAO,CAAA;CAClB,CAsBA"}
1
+ {"version":3,"file":"useFilteredDocuments.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFilteredDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAqC,MAAM,oBAAoB,CAAA;AAa5F,wBAAgB,oBAAoB,IAAI;IACtC,OAAO,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IACxC,QAAQ,EAAE,OAAO,CAAA;CAClB,CAsFA"}
@@ -1,49 +1,85 @@
1
- import { GherkinDocumentWalker, rejectAllFilters } from '@cucumber/gherkin-utils';
2
- import { useEffect, useState } from 'react';
3
- import { createSearch } from '../search/index.js';
1
+ import { TestStepResultStatus } from '@cucumber/messages';
2
+ import { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { createSearchIndex, deriveLineageConstraints, pruneGherkinDocuments, } from '../search/index.js';
4
+ import { ensure } from './helpers.js';
4
5
  import { useQueries } from './useQueries.js';
5
6
  import { useSearch } from './useSearch.js';
6
7
  export function useFilteredDocuments() {
7
- const { query, hideStatuses, unchanged } = useSearch();
8
- const { gherkinQuery, cucumberQuery } = useQueries();
9
- const [searchable, setSearchable] = useState();
8
+ const { cucumberQuery, gherkinQuery } = useQueries();
9
+ const allTestCasesStarted = useMemo(() => cucumberQuery.findAllTestCaseStarted(), [cucumberQuery]);
10
+ const gherkinDocuments = useMemo(() => gherkinQuery.getGherkinDocuments(), [gherkinQuery]);
11
+ const { hideStatuses, tagExpression, searchTerm, unchanged } = useSearch();
12
+ const lineageConstraints = useMemo(() => {
13
+ const candidates = [];
14
+ for (const testCaseStarted of allTestCasesStarted) {
15
+ if (hideStatuses.length) {
16
+ const status = cucumberQuery.findMostSevereTestStepResultBy(testCaseStarted)?.status ??
17
+ TestStepResultStatus.UNKNOWN;
18
+ if (hideStatuses.includes(status)) {
19
+ continue;
20
+ }
21
+ }
22
+ const pickle = ensure(cucumberQuery.findPickleBy(testCaseStarted), `No Pickle found for TestCaseStarted ${testCaseStarted.id}`);
23
+ if (tagExpression) {
24
+ const tags = pickle.tags.map((tag) => tag.name);
25
+ if (!tagExpression.evaluate(tags)) {
26
+ continue;
27
+ }
28
+ }
29
+ const lineage = ensure(cucumberQuery.findLineageBy(pickle), `No Lineage found for Pickle ${pickle.uri}`);
30
+ candidates.push({ pickle, lineage });
31
+ }
32
+ return deriveLineageConstraints(candidates);
33
+ }, [allTestCasesStarted, cucumberQuery, hideStatuses, tagExpression]);
34
+ const [searchIndex, setSearchIndex] = useState();
10
35
  const [results, setResults] = useState();
36
+ const setResultsSorting = useCallback((unsorted) => {
37
+ const sorted = [...unsorted];
38
+ sorted.sort((a, b) => (a.uri || '').localeCompare(b.uri || ''));
39
+ setResults(sorted);
40
+ }, []);
41
+ useEffect(() => {
42
+ createSearchIndex(gherkinDocuments)
43
+ .then((created) => setSearchIndex(created))
44
+ .catch((error) => {
45
+ console.error('Failed to create search index:', error);
46
+ setSearchIndex(false);
47
+ });
48
+ }, [gherkinDocuments]);
11
49
  useEffect(() => {
12
- createSearch(gherkinQuery).then((created) => setSearchable(created));
13
- }, [gherkinQuery]);
50
+ if (searchTerm) {
51
+ // we only deal with the non-search path in this effect
52
+ return;
53
+ }
54
+ setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints));
55
+ }, [gherkinDocuments, lineageConstraints, searchTerm, setResultsSorting]);
14
56
  useEffect(() => {
15
- if (!searchable) {
57
+ if (!searchTerm) {
58
+ // we only deal with the search path in this effect
16
59
  return;
17
60
  }
18
- searchable.search(query).then((searched) => {
19
- const filtered = filterByStatus(searched, hideStatuses, cucumberQuery);
20
- const sorted = sortByUri(filtered);
21
- setResults(sorted);
61
+ if (searchIndex === undefined) {
62
+ // search index is not ready yet
63
+ return;
64
+ }
65
+ if (searchIndex === false) {
66
+ // search index failed to create - fallback
67
+ setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints));
68
+ return;
69
+ }
70
+ searchIndex
71
+ .search(searchTerm)
72
+ .then((searchHits) => {
73
+ setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints, searchHits));
74
+ })
75
+ .catch((error) => {
76
+ console.error('Search failed:', error);
77
+ setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints));
22
78
  });
23
- }, [query, hideStatuses, cucumberQuery, searchable]);
79
+ }, [gherkinDocuments, lineageConstraints, searchIndex, searchTerm, setResultsSorting]);
24
80
  return {
25
81
  results,
26
82
  filtered: !unchanged,
27
83
  };
28
84
  }
29
- function filterByStatus(searched, hideStatuses, query) {
30
- const walker = new GherkinDocumentWalker({
31
- ...rejectAllFilters,
32
- acceptScenario: (scenario) => {
33
- return query
34
- .findAllTestCaseStarted()
35
- .filter((started) => query.findLineageBy(started)?.scenario?.id === scenario.id)
36
- .map((started) => query.findMostSevereTestStepResultBy(started)?.status)
37
- .some((status) => !hideStatuses.includes(status));
38
- },
39
- });
40
- return searched
41
- .map((original) => walker.walkGherkinDocument(original))
42
- .filter((gherkinDocument) => !!gherkinDocument);
43
- }
44
- function sortByUri(filtered) {
45
- const sorted = [...filtered];
46
- sorted.sort((a, b) => (a.uri || '').localeCompare(b.uri || ''));
47
- return sorted;
48
- }
49
85
  //# sourceMappingURL=useFilteredDocuments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFilteredDocuments.js","sourceRoot":"","sources":["../../../src/hooks/useFilteredDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAGjF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,UAAU,oBAAoB;IAIlC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAAA;IACtD,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACpD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,EAAc,CAAA;IAC1D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAqB,CAAA;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;IACtE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAClB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,UAAU,EAAE;YACf,OAAM;SACP;QACD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACzC,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC,CAAA;YACtE,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AC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAA;IAC/D,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { GherkinDocumentWalker, rejectAllFilters } from '@cucumber/gherkin-utils'\nimport { GherkinDocument, TestStepResultStatus } from '@cucumber/messages'\nimport { Query } from '@cucumber/query'\nimport { useEffect, useState } from 'react'\n\nimport { createSearch, Searchable } from '../search/index.js'\nimport { useQueries } from './useQueries.js'\nimport { useSearch } from './useSearch.js'\n\nexport function useFilteredDocuments(): {\n results: GherkinDocument[] | undefined\n filtered: boolean\n} {\n const { query, hideStatuses, unchanged } = useSearch()\n const { gherkinQuery, cucumberQuery } = useQueries()\n const [searchable, setSearchable] = useState<Searchable>()\n const [results, setResults] = useState<GherkinDocument[]>()\n useEffect(() => {\n createSearch(gherkinQuery).then((created) => setSearchable(created))\n }, [gherkinQuery])\n useEffect(() => {\n if (!searchable) {\n return\n }\n searchable.search(query).then((searched) => {\n const filtered = filterByStatus(searched, hideStatuses, cucumberQuery)\n const sorted = sortByUri(filtered)\n setResults(sorted)\n })\n }, [query, hideStatuses, cucumberQuery, searchable])\n return {\n results,\n filtered: !unchanged,\n }\n}\n\nfunction filterByStatus(\n searched: ReadonlyArray<GherkinDocument>,\n hideStatuses: ReadonlyArray<TestStepResultStatus>,\n query: Query\n): ReadonlyArray<GherkinDocument> {\n const walker = new GherkinDocumentWalker({\n ...rejectAllFilters,\n acceptScenario: (scenario) => {\n return query\n .findAllTestCaseStarted()\n .filter((started) => query.findLineageBy(started)?.scenario?.id === scenario.id)\n .map((started) => query.findMostSevereTestStepResultBy(started)?.status)\n .some((status) => !hideStatuses.includes(status as TestStepResultStatus))\n },\n })\n\n return searched\n .map((original) => walker.walkGherkinDocument(original))\n .filter((gherkinDocument) => !!gherkinDocument) as ReadonlyArray<GherkinDocument>\n}\n\nfunction sortByUri(filtered: ReadonlyArray<GherkinDocument>) {\n const sorted = [...filtered]\n sorted.sort((a, b) => (a.uri || '').localeCompare(b.uri || ''))\n return sorted\n}\n"]}
1
+ {"version":3,"file":"useFilteredDocuments.js","sourceRoot":"","sources":["../../../src/hooks/useFilteredDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAE5F,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,UAAU,oBAAoB;IAIlC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE,CAAA;IACpD,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,sBAAsB,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;IAClG,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,mBAAmB,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAC1F,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAAA;IAC1E,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,MAAM,UAAU,GAAgD,EAAE,CAAA;QAClE,KAAK,MAAM,eAAe,IAAI,mBAAmB,EAAE,CAAC;YAClD,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;gBACxB,MAAM,MAAM,GACV,aAAa,CAAC,8BAA8B,CAAC,eAAe,CAAC,EAAE,MAAM;oBACrE,oB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,CAAC,CAAC,CAAA;QAC5F,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;YACtC,iBAAiB,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAChF,CAAC,CAAC,CAAA;IACN,CAAC,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAEtF,OAAO;QACL,OAAO;QACP,QAAQ,EAAE,CAAC,SAAS;KACrB,CAAA;AACH,CAAC","sourcesContent":["import { type GherkinDocument, type Pickle, TestStepResultStatus } from '@cucumber/messages'\nimport type { Lineage } from '@cucumber/query'\nimport { type Dispatch, useCallback, useEffect, useMemo, useState } from 'react'\nimport {\n createSearchIndex,\n deriveLineageConstraints,\n pruneGherkinDocuments,\n type SearchIndex,\n} from '../search/index.js'\nimport { ensure } from './helpers.js'\nimport { useQueries } from './useQueries.js'\nimport { useSearch } from './useSearch.js'\n\nexport function useFilteredDocuments(): {\n results?: ReadonlyArray<GherkinDocument>\n filtered: boolean\n} {\n const { cucumberQuery, gherkinQuery } = useQueries()\n const allTestCasesStarted = useMemo(() => cucumberQuery.findAllTestCaseStarted(), [cucumberQuery])\n const gherkinDocuments = useMemo(() => gherkinQuery.getGherkinDocuments(), [gherkinQuery])\n const { hideStatuses, tagExpression, searchTerm, unchanged } = useSearch()\n const lineageConstraints = useMemo(() => {\n const candidates: Array<{ pickle: Pickle; lineage: Lineage }> = []\n for (const testCaseStarted of allTestCasesStarted) {\n if (hideStatuses.length) {\n const status =\n cucumberQuery.findMostSevereTestStepResultBy(testCaseStarted)?.status ??\n TestStepResultStatus.UNKNOWN\n if (hideStatuses.includes(status)) {\n continue\n }\n }\n const pickle = ensure(\n cucumberQuery.findPickleBy(testCaseStarted),\n `No Pickle found for TestCaseStarted ${testCaseStarted.id}`\n )\n if (tagExpression) {\n const tags = pickle.tags.map((tag) => tag.name)\n if (!tagExpression.evaluate(tags)) {\n continue\n }\n }\n const lineage = ensure(\n cucumberQuery.findLineageBy(pickle),\n `No Lineage found for Pickle ${pickle.uri}`\n )\n candidates.push({ pickle, lineage })\n }\n return deriveLineageConstraints(candidates)\n }, [allTestCasesStarted, cucumberQuery, hideStatuses, tagExpression])\n const [searchIndex, setSearchIndex] = useState<SearchIndex | false>()\n const [results, setResults] = useState<ReadonlyArray<GherkinDocument>>()\n const setResultsSorting: Dispatch<ReadonlyArray<GherkinDocument>> = useCallback((unsorted) => {\n const sorted = [...unsorted]\n sorted.sort((a, b) => (a.uri || '').localeCompare(b.uri || ''))\n setResults(sorted)\n }, [])\n\n useEffect(() => {\n createSearchIndex(gherkinDocuments)\n .then((created) => setSearchIndex(created))\n .catch((error) => {\n console.error('Failed to create search index:', error)\n setSearchIndex(false)\n })\n }, [gherkinDocuments])\n useEffect(() => {\n if (searchTerm) {\n // we only deal with the non-search path in this effect\n return\n }\n setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints))\n }, [gherkinDocuments, lineageConstraints, searchTerm, setResultsSorting])\n useEffect(() => {\n if (!searchTerm) {\n // we only deal with the search path in this effect\n return\n }\n if (searchIndex === undefined) {\n // search index is not ready yet\n return\n }\n if (searchIndex === false) {\n // search index failed to create - fallback\n setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints))\n return\n }\n searchIndex\n .search(searchTerm)\n .then((searchHits) => {\n setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints, searchHits))\n })\n .catch((error) => {\n console.error('Search failed:', error)\n setResultsSorting(pruneGherkinDocuments(gherkinDocuments, lineageConstraints))\n })\n }, [gherkinDocuments, lineageConstraints, searchIndex, searchTerm, setResultsSorting])\n\n return {\n results,\n filtered: !unchanged,\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useMostSevereStatusByUri.js","sourceRoot":"","s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epResultStatus } from '@cucumber/messages'\nimport { SetMultimap } from '@teppeis/multimaps'\nimport { useMemo } from 'react'\n\nimport { findMostSevereTestStepResultStatus } from '../components/app/findMostSevereTestStepResultStatus.js'\nimport { useQueries } from './useQueries.js'\n\nexport function useMostSevereStatusByUri(): Map<string, TestStepResultStatus> {\n const { cucumberQuery } = useQueries()\n return useMemo(() => {\n const allByUri = new SetMultimap<string, TestStepResultStatus>()\n for (const testCaseStarted of cucumberQuery.findAllTestCaseStarted()) {\n const result = cucumberQuery.findMostSevereTestStepResultBy(testCaseStarted)\n const status = result ? result.status : TestStepResultStatus.UNKNOWN\n const pickle = cucumberQuery.findPickleBy(testCaseStarted)\n if (pickle?.uri) {\n allByUri.put(pickle.uri, status)\n }\n }\n const mostSevereByUri = new Map<string, TestStepResultStatus>()\n for (const key of allByUri.keys()) {\n mostSevereByUri.set(key, findMostSevereTestStepResultStatus(allByUri.get(key)))\n }\n return mostSevereByUri\n }, [cucumberQuery])\n}\n"]}
1
+ {"version":3,"file":"useMostSevereStatusByUri.js","sourceRoot":"","sources":["../../../src/hooks/useMostSevereStatusByUri.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,yDAAyD,CAAA;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,UAAU,wBAAwB;IACtC,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAgC,CAAA;QAChE,KAAK,MAAM,eAAe,IAAI,aAAa,CAAC,sBAAsB,EAAE,EAAE,CAAC;YACrE,MAAM,MAAM,GAAG,aAAa,CAAC,8BAA8B,CAAC,eAAe,CAAC,CAAA;YAC5E,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAA;YACpE,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;YAC1D,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC;gBAChB,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;QACD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAA;QAC/D,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;YAClC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,kCAAkC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACjF,CAAC;QACD,OAAO,eAAe,CAAA;IACxB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;AACrB,CAAC","sourcesContent":["import { TestStepResultStatus } from '@cucumber/messages'\nimport { SetMultimap } from '@teppeis/multimaps'\nimport { useMemo } from 'react'\n\nimport { findMostSevereTestStepResultStatus } from '../components/app/findMostSevereTestStepResultStatus.js'\nimport { useQueries } from './useQueries.js'\n\nexport function useMostSevereStatusByUri(): Map<string, TestStepResultStatus> {\n const { cucumberQuery } = useQueries()\n return useMemo(() => {\n const allByUri = new SetMultimap<string, TestStepResultStatus>()\n for (const testCaseStarted of cucumberQuery.findAllTestCaseStarted()) {\n const result = cucumberQuery.findMostSevereTestStepResultBy(testCaseStarted)\n const status = result ? result.status : TestStepResultStatus.UNKNOWN\n const pickle = cucumberQuery.findPickleBy(testCaseStarted)\n if (pickle?.uri) {\n allByUri.put(pickle.uri, status)\n }\n }\n const mostSevereByUri = new Map<string, TestStepResultStatus>()\n for (const key of allByUri.keys()) {\n mostSevereByUri.set(key, findMostSevereTestStepResultStatus(allByUri.get(key)))\n }\n return mostSevereByUri\n }, [cucumberQuery])\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { Query as GherkinQuery } from '@cucumber/gherkin-utils';
2
- import { Query as CucumberQuery } from '@cucumber/query';
1
+ import type { Query as GherkinQuery } from '@cucumber/gherkin-utils';
2
+ import type { Query as CucumberQuery } from '@cucumber/query';
3
3
  export declare function useQueries(): {
4
4
  cucumberQuery: CucumberQuery;
5
5
  gherkinQuery: GherkinQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAMxD,wBAAgB,UAAU,IAAI;IAC5B,aAAa,EAAE,aAAa,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;CAC3B,CAIA"}
1
+ {"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAM7D,wBAAgB,UAAU,IAAI;IAC5B,aAAa,EAAE,aAAa,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;CAC3B,CAIA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useQueries.js","sourceRoot":"","sources":["../../../src/hooks/useQueries.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,oBAAoB,MAAM,4BAA4B,CAAA;AAC7D,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAE3D,MAAM,UAAU,UAAU;IAIxB,MAAM,YAAY,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import { Query as GherkinQuery } from '@cucumber/gherkin-utils'\nimport { Query as CucumberQuery } from '@cucumber/query'\nimport { useContext } from 'react'\n\nimport CucumberQueryContext from '../CucumberQueryContext.js'\nimport GherkinQueryContext from '../GherkinQueryContext.js'\n\nexport function useQueries(): {\n cucumberQuery: CucumberQuery\n gherkinQuery: GherkinQuery\n} {\n const gherkinQuery = useContext(GherkinQueryContext)\n const cucumberQuery = useContext(CucumberQueryContext)\n return { cucumberQuery, gherkinQuery }\n}\n"]}
1
+ {"version":3,"file":"useQueries.js","sourceRoot":"","sources":["../../../src/hooks/useQueries.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,oBAAoB,MAAM,4BAA4B,CAAA;AAC7D,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAE3D,MAAM,UAAU,UAAU;IAIxB,MAAM,YAAY,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import type { Query as GherkinQuery } from '@cucumber/gherkin-utils'\nimport type { Query as CucumberQuery } from '@cucumber/query'\nimport { useContext } from 'react'\n\nimport CucumberQueryContext from '../CucumberQueryContext.js'\nimport GherkinQueryContext from '../GherkinQueryContext.js'\n\nexport function useQueries(): {\n cucumberQuery: CucumberQuery\n gherkinQuery: GherkinQuery\n} {\n const gherkinQuery = useContext(GherkinQueryContext)\n const cucumberQuery = useContext(CucumberQueryContext)\n return { cucumberQuery, gherkinQuery }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { TestStepResultStatus } from '@cucumber/messages';
1
+ import type { TestStepResultStatus } from '@cucumber/messages';
2
2
  export declare function useResultStatistics(): {
3
3
  scenarioCountByStatus: Record<TestStepResultStatus, number>;
4
4
  statusesWithScenarios: readonly TestStepResultStatus[];
@@ -1 +1 @@
1
- {"version":3,"file":"useResultStatistics.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResultStatistics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAKzD,wBAAgB,mBAAmB,IAAI;IACrC,qBAAqB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAA;IAC3D,qBAAqB,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACtD,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAiBA"}
1
+ {"version":3,"file":"useResultStatistics.d.ts","sourceRoot":"","sources":["../../../src/hooks/useResultStatistics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAK9D,wBAAgB,mBAAmB,IAAI;IACrC,qBAAqB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAA;IAC3D,qBAAqB,EAAE,SAAS,oBAAoB,EAAE,CAAA;IACtD,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAiBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useResultStatistics.js","sourceRoot":"","sources":["../../../src/hooks/useResultStatistics.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,UAAU,mBAAmB;IAKjC,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,qBAAqB,GAAG,aAAa,CAAC,mCAAmC,EAAE,CAAA;IAEjF,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;SAChE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,OAAO,KAAK,GAAG,CAAC,CAAA;IAClB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,gBAAgB,CAA2B,CAAA;IAEnD,MAAM,kBAAkB,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CACzE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,EAC3B,CAAC,CACF,CAAA;IAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;AAC7E,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAuB,EAAE,CAAuB;IACxE,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC7C,OAAO,CAAC,CAAC,CAAA;KACV;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAC7C,OAAO,CAAC,CAAA;KACT;IACD,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["import { TestStepResultStatus } from '@cucumber/messages'\n\nimport statuses from '../statuses.js'\nimport { useQueries } from './useQueries.js'\n\nexport function useResultStatistics(): {\n scenarioCountByStatus: Record<TestStepResultStatus, number>\n statusesWithScenarios: readonly TestStepResultStatus[]\n totalScenarioCount: number\n} {\n const { cucumberQuery } = useQueries()\n const scenarioCountByStatus = cucumberQuery.countMostSevereTestStepResultStatus()\n\n const statusesWithScenarios = Object.entries(scenarioCountByStatus)\n .filter(([, value]) => {\n return value > 0\n })\n .map(([key]) => key)\n .sort(statusComparator) as TestStepResultStatus[]\n\n const totalScenarioCount = [...Object.values(scenarioCountByStatus)].reduce(\n (prev, curr) => prev + curr,\n 0\n )\n\n return { scenarioCountByStatus, statusesWithScenarios, totalScenarioCount }\n}\n\nfunction statusComparator(a: TestStepResultStatus, b: TestStepResultStatus) {\n if (statuses.indexOf(a) < statuses.indexOf(b)) {\n return -1\n }\n if (statuses.indexOf(a) > statuses.indexOf(b)) {\n return 1\n }\n return 0\n}\n"]}
1
+ {"version":3,"file":"useResultStatistics.js","sourceRoot":"","sources":["../../../src/hooks/useResultStatistics.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,UAAU,mBAAmB;IAKjC,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,qBAAqB,GAAG,aAAa,CAAC,mCAAmC,EAAE,CAAA;IAEjF,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC;SAChE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,OAAO,KAAK,GAAG,CAAC,CAAA;IAClB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC;SACnB,IAAI,CAAC,gBAAgB,CAA2B,CAAA;IAEnD,MAAM,kBAAkB,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CACzE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,EAC3B,CAAC,CACF,CAAA;IAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;AAC7E,CAAC;AAED,SAAS,gBAAgB,CAAC,CAAuB,EAAE,CAAuB;IACxE,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,CAAA;IACV,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC","sourcesContent":["import type { TestStepResultStatus } from '@cucumber/messages'\n\nimport statuses from '../statuses.js'\nimport { useQueries } from './useQueries.js'\n\nexport function useResultStatistics(): {\n scenarioCountByStatus: Record<TestStepResultStatus, number>\n statusesWithScenarios: readonly TestStepResultStatus[]\n totalScenarioCount: number\n} {\n const { cucumberQuery } = useQueries()\n const scenarioCountByStatus = cucumberQuery.countMostSevereTestStepResultStatus()\n\n const statusesWithScenarios = Object.entries(scenarioCountByStatus)\n .filter(([, value]) => {\n return value > 0\n })\n .map(([key]) => key)\n .sort(statusComparator) as TestStepResultStatus[]\n\n const totalScenarioCount = [...Object.values(scenarioCountByStatus)].reduce(\n (prev, curr) => prev + curr,\n 0\n )\n\n return { scenarioCountByStatus, statusesWithScenarios, totalScenarioCount }\n}\n\nfunction statusComparator(a: TestStepResultStatus, b: TestStepResultStatus) {\n if (statuses.indexOf(a) < statuses.indexOf(b)) {\n return -1\n }\n if (statuses.indexOf(a) > statuses.indexOf(b)) {\n return 1\n }\n return 0\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { SearchContextValue } from '../SearchContext.js';
1
+ import { type SearchContextValue } from '../SearchContext.js';
2
2
  export declare function useSearch(): SearchContextValue;
3
3
  //# sourceMappingURL=useSearch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":"AAEA,OAA2B,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE5E,wBAAgB,SAAS,IAAI,kBAAkB,CAE9C"}
1
+ {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":"AAEA,OAA2B,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAEjF,wBAAgB,SAAS,IAAI,kBAAkB,CAE9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,kBAA0C,MAAM,qBAAqB,CAAA;AAE5E,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAA;AACvC,CAAC","sourcesContent":["import { useContext } from 'react'\n\nimport SearchQueryContext, { SearchContextValue } from '../SearchContext.js'\n\nexport function useSearch(): SearchContextValue {\n return useContext(SearchQueryContext)\n}\n"]}
1
+ {"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../../src/hooks/useSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,kBAA+C,MAAM,qBAAqB,CAAA;AAEjF,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAA;AACvC,CAAC","sourcesContent":["import { useContext } from 'react'\n\nimport SearchQueryContext, { type SearchContextValue } from '../SearchContext.js'\n\nexport function useSearch(): SearchContextValue {\n return useContext(SearchQueryContext)\n}\n"]}
@@ -1,3 +1,8 @@
1
- import { TestCaseStarted } from '@cucumber/messages';
1
+ import type { TestCaseStarted } from '@cucumber/messages';
2
+ /**
3
+ * Finds the corresponding TestCaseStarted for an Example or Scenario node from a Gherkin
4
+ * document
5
+ * @param nodeId the Gherkin node id
6
+ */
2
7
  export declare function useTestCaseStarted(nodeId: string): TestCaseStarted | undefined;
3
8
  //# sourceMappingURL=useTestCaseStarted.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTestCaseStarted.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTestCaseStarted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAKpD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAa9E"}
1
+ {"version":3,"file":"useTestCaseStarted.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTestCaseStarted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAKzD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAW9E"}
@@ -1,17 +1,20 @@
1
1
  import { useMemo } from 'react';
2
2
  import { useQueries } from './useQueries.js';
3
+ /**
4
+ * Finds the corresponding TestCaseStarted for an Example or Scenario node from a Gherkin
5
+ * document
6
+ * @param nodeId the Gherkin node id
7
+ */
3
8
  export function useTestCaseStarted(nodeId) {
4
9
  const { cucumberQuery } = useQueries();
5
- const mapped = useMemo(() => {
6
- return cucumberQuery.findAllTestCaseStarted().reduce((prev, testCaseStarted) => {
7
- const lineage = cucumberQuery.findLineageBy(testCaseStarted);
8
- const closestNodeId = lineage?.example?.id ?? lineage?.scenario?.id;
9
- if (closestNodeId) {
10
- prev.set(closestNodeId, testCaseStarted);
10
+ return useMemo(() => {
11
+ for (const testCaseStarted of cucumberQuery.findAllTestCaseStarted()) {
12
+ const pickle = cucumberQuery.findPickleBy(testCaseStarted);
13
+ const closestNodeId = pickle?.astNodeIds.at(-1);
14
+ if (closestNodeId === nodeId) {
15
+ return testCaseStarted;
11
16
  }
12
- return prev;
13
- }, new Map());
14
- }, [cucumberQuery]);
15
- return mapped.get(nodeId);
17
+ }
18
+ }, [cucumberQuery, nodeId]);
16
19
  }
17
20
  //# sourceMappingURL=useTestCaseStarted.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTestCaseStarted.js","sourceRoot":"","sources":["../../../src/hooks/useTestCaseStarted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,OAAO,aAAa,CAAC,sBAAsB,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE;YAC7E,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA;YAC5D,MAAM,aAAa,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAA;YACnE,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,eAAe,CAAC,CAAA;aACzC;YACD,OAAO,IAAI,CAAA;QACb,CAAC,EAAE,IAAI,GAAG,EAA2B,CAAC,CAAA;IACxC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;IACnB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import { TestCaseStarted } from '@cucumber/messages'\nimport { useMemo } from 'react'\n\nimport { useQueries } from './useQueries.js'\n\nexport function useTestCaseStarted(nodeId: string): TestCaseStarted | undefined {\n const { cucumberQuery } = useQueries()\n const mapped = useMemo(() => {\n return cucumberQuery.findAllTestCaseStarted().reduce((prev, testCaseStarted) => {\n const lineage = cucumberQuery.findLineageBy(testCaseStarted)\n const closestNodeId = lineage?.example?.id ?? lineage?.scenario?.id\n if (closestNodeId) {\n prev.set(closestNodeId, testCaseStarted)\n }\n return prev\n }, new Map<string, TestCaseStarted>())\n }, [cucumberQuery])\n return mapped.get(nodeId)\n}\n"]}
1
+ {"version":3,"file":"useTestCaseStarted.js","sourceRoot":"","sources":["../../../src/hooks/useTestCaseStarted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,KAAK,MAAM,eAAe,IAAI,aAAa,CAAC,sBAAsB,EAAE,EAAE,CAAC;YACrE,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;YAC1D,MAAM,aAAa,GAAG,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/C,IAAI,aAAa,KAAK,MAAM,EAAE,CAAC;gBAC7B,OAAO,eAAe,CAAA;YACxB,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;AAC7B,CAAC","sourcesContent":["import type { TestCaseStarted } from '@cucumber/messages'\nimport { useMemo } from 'react'\n\nimport { useQueries } from './useQueries.js'\n\n/**\n * Finds the corresponding TestCaseStarted for an Example or Scenario node from a Gherkin\n * document\n * @param nodeId the Gherkin node id\n */\nexport function useTestCaseStarted(nodeId: string): TestCaseStarted | undefined {\n const { cucumberQuery } = useQueries()\n return useMemo(() => {\n for (const testCaseStarted of cucumberQuery.findAllTestCaseStarted()) {\n const pickle = cucumberQuery.findPickleBy(testCaseStarted)\n const closestNodeId = pickle?.astNodeIds.at(-1)\n if (closestNodeId === nodeId) {\n return testCaseStarted\n }\n }\n }, [cucumberQuery, nodeId])\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Hook, TestRunHookFinished } from '@cucumber/messages';
1
+ import type { Hook, TestRunHookFinished } from '@cucumber/messages';
2
2
  type RunHooksList = {
3
3
  testRunHookFinished: TestRunHookFinished;
4
4
  hook: Hook;
@@ -1 +1 @@
1
- {"version":3,"file":"useTestRunHooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTestRunHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAK9D,KAAK,YAAY,GAAG;IAAE,mBAAmB,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAAE,CAAA;AAE9E,wBAAgB,eAAe,IAAI,YAAY,CAgB9C"}
1
+ {"version":3,"file":"useTestRunHooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTestRunHooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAKnE,KAAK,YAAY,GAAG;IAAE,mBAAmB,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAAE,CAAA;AAE9E,wBAAgB,eAAe,IAAI,YAAY,CAgB9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTestRunHooks.js","sourceRoot":"","sources":["../../../src/hooks/useTestRunHooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI5C,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,oBAAoB,GACxB,aAAa,CAAC,0BAA0B,EAAE,CAAA;IAE5C,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;QACtD,MAAM,IAAI,GAAG,MAAM,CACjB,aAAa,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAC7C,qDAAqD,CACtD,CAAA;QAED,OAAO;YACL,mBAAmB;YACnB,IAAI;SACL,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Hook, TestRunHookFinished } from '@cucumber/messages'\n\nimport { ensure } from './helpers.js'\nimport { useQueries } from './useQueries.js'\n\ntype RunHooksList = { testRunHookFinished: TestRunHookFinished; hook: Hook }[]\n\nexport function useTestRunHooks(): RunHooksList {\n const { cucumberQuery } = useQueries()\n const testRunHooksFinished: ReadonlyArray<TestRunHookFinished> =\n cucumberQuery.findAllTestRunHookFinished()\n\n return testRunHooksFinished.map((testRunHookFinished) => {\n const hook = ensure(\n cucumberQuery.findHookBy(testRunHookFinished),\n 'Expected testRunHookFinished to resolve with a hook'\n )\n\n return {\n testRunHookFinished,\n hook,\n }\n })\n}\n"]}
1
+ {"version":3,"file":"useTestRunHooks.js","sourceRoot":"","sources":["../../../src/hooks/useTestRunHooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI5C,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAA;IACtC,MAAM,oBAAoB,GACxB,aAAa,CAAC,0BAA0B,EAAE,CAAA;IAE5C,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;QACtD,MAAM,IAAI,GAAG,MAAM,CACjB,aAAa,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAC7C,qDAAqD,CACtD,CAAA;QAED,OAAO;YACL,mBAAmB;YACnB,IAAI;SACL,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import type { Hook, TestRunHookFinished } from '@cucumber/messages'\n\nimport { ensure } from './helpers.js'\nimport { useQueries } from './useQueries.js'\n\ntype RunHooksList = { testRunHookFinished: TestRunHookFinished; hook: Hook }[]\n\nexport function useTestRunHooks(): RunHooksList {\n const { cucumberQuery } = useQueries()\n const testRunHooksFinished: ReadonlyArray<TestRunHookFinished> =\n cucumberQuery.findAllTestRunHookFinished()\n\n return testRunHooksFinished.map((testRunHookFinished) => {\n const hook = ensure(\n cucumberQuery.findHookBy(testRunHookFinished),\n 'Expected testRunHookFinished to resolve with a hook'\n )\n\n return {\n testRunHookFinished,\n hook,\n }\n })\n}\n"]}