@allurereport/web-awesome 3.0.1 → 3.1.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 (140) hide show
  1. package/dist/multi/173.app-79c65c7bff941abcbc51.js +1 -0
  2. package/dist/multi/174.app-79c65c7bff941abcbc51.js +1 -0
  3. package/dist/multi/252.app-79c65c7bff941abcbc51.js +1 -0
  4. package/dist/multi/282.app-79c65c7bff941abcbc51.js +1 -0
  5. package/dist/multi/29.app-79c65c7bff941abcbc51.js +1 -0
  6. package/dist/multi/416.app-79c65c7bff941abcbc51.js +1 -0
  7. package/dist/multi/527.app-79c65c7bff941abcbc51.js +1 -0
  8. package/dist/multi/600.app-79c65c7bff941abcbc51.js +1 -0
  9. package/dist/multi/605.app-79c65c7bff941abcbc51.js +1 -0
  10. package/dist/multi/638.app-79c65c7bff941abcbc51.js +1 -0
  11. package/dist/multi/672.app-79c65c7bff941abcbc51.js +1 -0
  12. package/dist/multi/686.app-79c65c7bff941abcbc51.js +1 -0
  13. package/dist/multi/725.app-79c65c7bff941abcbc51.js +1 -0
  14. package/dist/multi/741.app-79c65c7bff941abcbc51.js +1 -0
  15. package/dist/multi/755.app-79c65c7bff941abcbc51.js +1 -0
  16. package/dist/multi/894.app-79c65c7bff941abcbc51.js +1 -0
  17. package/dist/multi/91.app-79c65c7bff941abcbc51.js +1 -0
  18. package/dist/multi/943.app-79c65c7bff941abcbc51.js +1 -0
  19. package/dist/multi/980.app-79c65c7bff941abcbc51.js +1 -0
  20. package/dist/multi/app-79c65c7bff941abcbc51.js +2 -0
  21. package/dist/multi/{app-bae2a0fe5738d77cd976.js.LICENSE.txt → app-79c65c7bff941abcbc51.js.LICENSE.txt} +7 -0
  22. package/dist/multi/manifest.json +21 -21
  23. package/dist/multi/styles-9e390bad7ce54a807a8e.css +49 -0
  24. package/dist/single/app-3ca67f29d0f1166c08ca.js +2 -0
  25. package/dist/single/{app-996d3b5869f8fc942b66.js.LICENSE.txt → app-3ca67f29d0f1166c08ca.js.LICENSE.txt} +7 -0
  26. package/dist/single/manifest.json +1 -1
  27. package/package.json +7 -7
  28. package/src/assets/scss/vars.scss +3 -0
  29. package/src/components/BaseLayout/index.tsx +25 -21
  30. package/src/components/BaseLayout/styles.scss +1 -0
  31. package/src/components/Charts/index.tsx +5 -2
  32. package/src/components/Footer/FooterVersion.tsx +14 -8
  33. package/src/components/Header/index.tsx +9 -7
  34. package/src/components/HeaderControls/index.tsx +5 -2
  35. package/src/components/MainReport/styles.scss +1 -0
  36. package/src/components/Metadata/index.tsx +24 -7
  37. package/src/components/ReportBody/HeaderActions.tsx +4 -13
  38. package/src/components/ReportBody/SortBy.tsx +27 -13
  39. package/src/components/ReportBody/index.tsx +1 -1
  40. package/src/components/ReportBody/styles.scss +4 -1
  41. package/src/components/ReportFilters/BaseFilters.tsx +345 -0
  42. package/src/components/ReportFilters/RetryFlaky.tsx +29 -0
  43. package/src/components/ReportFilters/TagsFilter.tsx +41 -0
  44. package/src/components/ReportFilters/TransitionFilter.tsx +49 -0
  45. package/src/components/ReportFilters/index.tsx +44 -0
  46. package/src/components/ReportFilters/styles.scss +55 -0
  47. package/src/components/ReportSearch/index.tsx +29 -0
  48. package/src/components/ReportTabs/index.tsx +1 -1
  49. package/src/components/SectionPicker/index.tsx +1 -1
  50. package/src/components/SplitLayout/index.tsx +7 -3
  51. package/src/components/TestResult/TrEnvironmentItem/index.tsx +2 -2
  52. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +2 -2
  53. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +38 -7
  54. package/src/components/TestResult/TrHistory/index.tsx +18 -8
  55. package/src/components/TestResult/TrHistory/styles.scss +4 -7
  56. package/src/components/TestResult/TrInfo/styles.scss +1 -0
  57. package/src/components/TestResult/TrNavigation/index.tsx +109 -68
  58. package/src/components/TestResult/TrNavigation/styles.scss +15 -25
  59. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +1 -8
  60. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +2 -3
  61. package/src/components/TestResult/TrRetriesView/index.tsx +4 -3
  62. package/src/components/TestResult/TrSteps/TrAttachment.tsx +5 -3
  63. package/src/components/TestResult/TrSteps/TrAttachmentInfo.tsx +10 -3
  64. package/src/components/TestResult/TrTabs/index.tsx +7 -23
  65. package/src/components/TestResult/index.tsx +9 -4
  66. package/src/components/TestResult/styles.scss +1 -0
  67. package/src/components/Tree/index.tsx +14 -9
  68. package/src/index.html +19 -18
  69. package/src/index.tsx +20 -27
  70. package/src/locales/az.json +39 -11
  71. package/src/locales/de.json +39 -11
  72. package/src/locales/en.json +39 -11
  73. package/src/locales/es.json +39 -11
  74. package/src/locales/fr.json +39 -11
  75. package/src/locales/he.json +39 -11
  76. package/src/locales/hy.json +39 -11
  77. package/src/locales/it.json +39 -11
  78. package/src/locales/ja.json +39 -11
  79. package/src/locales/ka.json +39 -11
  80. package/src/locales/kr.json +39 -11
  81. package/src/locales/nl.json +39 -11
  82. package/src/locales/pl.json +39 -11
  83. package/src/locales/pt.json +39 -11
  84. package/src/locales/ru.json +39 -11
  85. package/src/locales/sv.json +39 -11
  86. package/src/locales/tr.json +39 -11
  87. package/src/locales/ua.json +39 -11
  88. package/src/locales/zh.json +39 -11
  89. package/src/stores/chart.ts +2 -2
  90. package/src/stores/env.ts +6 -6
  91. package/src/stores/envInfo.ts +2 -2
  92. package/src/stores/globals.ts +1 -1
  93. package/src/stores/index.ts +0 -1
  94. package/src/stores/layout.ts +20 -11
  95. package/src/stores/locale.ts +2 -1
  96. package/src/stores/qualityGate.ts +2 -2
  97. package/src/stores/router.ts +25 -91
  98. package/src/stores/sections.ts +32 -45
  99. package/src/stores/stats.ts +4 -4
  100. package/src/stores/testResult.ts +5 -0
  101. package/src/stores/testResults.ts +7 -5
  102. package/src/stores/tree.ts +20 -13
  103. package/src/stores/treeFilters/actions.ts +48 -52
  104. package/src/stores/treeFilters/constants.ts +11 -5
  105. package/src/stores/treeFilters/model.ts +51 -0
  106. package/src/stores/treeFilters/store.ts +260 -60
  107. package/src/stores/treeFilters/utils.ts +132 -0
  108. package/src/stores/treeSort.ts +71 -0
  109. package/src/stores/variables.ts +3 -3
  110. package/src/utils/treeFilters.ts +48 -66
  111. package/test/components/Header.test.tsx +49 -58
  112. package/test/utils/treeFilters.test.ts +18 -321
  113. package/types.d.ts +2 -1
  114. package/dist/multi/173.app-bae2a0fe5738d77cd976.js +0 -1
  115. package/dist/multi/174.app-bae2a0fe5738d77cd976.js +0 -1
  116. package/dist/multi/252.app-bae2a0fe5738d77cd976.js +0 -1
  117. package/dist/multi/282.app-bae2a0fe5738d77cd976.js +0 -1
  118. package/dist/multi/29.app-bae2a0fe5738d77cd976.js +0 -1
  119. package/dist/multi/416.app-bae2a0fe5738d77cd976.js +0 -1
  120. package/dist/multi/527.app-bae2a0fe5738d77cd976.js +0 -1
  121. package/dist/multi/600.app-bae2a0fe5738d77cd976.js +0 -1
  122. package/dist/multi/605.app-bae2a0fe5738d77cd976.js +0 -1
  123. package/dist/multi/638.app-bae2a0fe5738d77cd976.js +0 -1
  124. package/dist/multi/672.app-bae2a0fe5738d77cd976.js +0 -1
  125. package/dist/multi/686.app-bae2a0fe5738d77cd976.js +0 -1
  126. package/dist/multi/725.app-bae2a0fe5738d77cd976.js +0 -1
  127. package/dist/multi/741.app-bae2a0fe5738d77cd976.js +0 -1
  128. package/dist/multi/755.app-bae2a0fe5738d77cd976.js +0 -1
  129. package/dist/multi/894.app-bae2a0fe5738d77cd976.js +0 -1
  130. package/dist/multi/91.app-bae2a0fe5738d77cd976.js +0 -1
  131. package/dist/multi/943.app-bae2a0fe5738d77cd976.js +0 -1
  132. package/dist/multi/980.app-bae2a0fe5738d77cd976.js +0 -1
  133. package/dist/multi/app-bae2a0fe5738d77cd976.js +0 -2
  134. package/dist/multi/styles-bbf68b2ba63c38b53c38.css +0 -48
  135. package/dist/single/app-996d3b5869f8fc942b66.js +0 -2
  136. package/src/components/ReportBody/Filters.tsx +0 -122
  137. package/src/stores/theme.ts +0 -30
  138. package/src/stores/treeFilters/index.ts +0 -3
  139. package/src/stores/treeFilters/types.ts +0 -12
  140. package/test/stores/treeFilters.test.ts +0 -302
@@ -11,103 +11,79 @@ import {
11
11
  ordinal,
12
12
  reverse,
13
13
  } from "@allurereport/core-api";
14
- import type { TreeFiltersState, TreeSortBy } from "@/stores/treeFilters";
14
+ import type { SortBy } from "@/stores/treeSort";
15
15
  import type { AwesomeRecursiveTree, AwesomeTree, AwesomeTreeGroup, AwesomeTreeLeaf } from "../../types";
16
16
 
17
- const matchesName = (name: string, query: string) => {
18
- return name.toLocaleLowerCase().includes(query.toLocaleLowerCase());
19
- };
20
-
21
- const matchesNodeId = (nodeId: string, query: string) => {
22
- return nodeId.toLowerCase() === query.toLocaleLowerCase();
23
- };
24
-
25
- export const isIncluded = (leaf: TreeLeaf<AwesomeTreeLeaf>, filterOptions: TreeFiltersState) => {
26
- const queryMatched =
27
- !filterOptions?.query ||
28
- matchesName(leaf.name, filterOptions.query) ||
29
- matchesNodeId(leaf.nodeId, filterOptions.query);
30
-
31
- const statusMatched =
32
- !filterOptions?.status || filterOptions?.status === "total" || leaf.status === filterOptions.status;
33
- const flakyMatched = !filterOptions?.filter?.flaky || leaf.flaky;
34
- const retryMatched = !filterOptions?.filter?.retry || leaf.retry;
35
- const newMatched = !filterOptions?.filter?.new || leaf.transition === "new";
36
- const fixedMatched = !filterOptions?.filter?.fixed || leaf.transition === "fixed";
37
- const regressedMatched = !filterOptions?.filter?.regressed || leaf.transition === "regressed";
38
- const malfunctionedMatched = !filterOptions?.filter?.malfunctioned || leaf.transition === "malfunctioned";
39
-
40
- return [
41
- queryMatched,
42
- statusMatched,
43
- flakyMatched,
44
- retryMatched,
45
- newMatched,
46
- fixedMatched,
47
- regressedMatched,
48
- malfunctionedMatched,
49
- ].every(Boolean);
50
- };
51
-
52
- const leafComparatorByTreeSortBy = (sortBy: TreeSortBy = "status"): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
17
+ const leafComparatorByTreeSortBy = (sortBy: SortBy = "status,asc"): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
53
18
  const typedCompareBy = compareBy<TreeLeaf<AwesomeTreeLeaf>>;
54
19
  switch (sortBy) {
55
- case "order":
20
+ case "order,asc":
21
+ case "order,desc":
56
22
  return typedCompareBy("groupOrder", ordinal());
57
- case "duration":
23
+ case "duration,asc":
24
+ case "duration,desc":
58
25
  return typedCompareBy("duration", ordinal());
59
- case "alphabet":
26
+ case "name,asc":
27
+ case "name,desc":
60
28
  return typedCompareBy("name", alphabetically());
61
- case "status":
29
+ case "status,asc":
30
+ case "status,desc":
62
31
  return typedCompareBy("status", byStatus());
63
32
  default:
64
33
  // eslint-disable-next-line no-console
65
- console.error(`unsupported comparator ${sortBy}`);
34
+ console.warn(`unsupported comparator ${sortBy as string}`);
66
35
  return () => 0;
67
36
  }
68
37
  };
69
38
 
70
- const groupComparatorByTreeSortBy = (sortBy: TreeSortBy = "status"): Comparator<DefaultTreeGroup> => {
39
+ const groupComparatorByTreeSortBy = (sortBy: SortBy = "status,asc"): Comparator<DefaultTreeGroup> => {
71
40
  const typedCompareBy = compareBy<DefaultTreeGroup>;
72
41
  switch (sortBy) {
73
- case "alphabet":
42
+ case "name,desc":
43
+ case "name,asc":
74
44
  return typedCompareBy("name", alphabetically());
75
- case "order":
76
- case "duration":
77
- case "status":
45
+ case "order,desc":
46
+ case "order,asc":
47
+ case "duration,desc":
48
+ case "duration,asc":
49
+ case "status,desc":
50
+ case "status,asc":
78
51
  return typedCompareBy("statistic", byStatistic());
79
52
  default:
80
53
  // eslint-disable-next-line no-console
81
- console.error(`unsupported comparator ${sortBy}`);
54
+ console.warn(`unsupported comparator ${sortBy as string}`);
82
55
  return () => 0;
83
56
  }
84
57
  };
85
58
 
86
- export const leafComparator = (filterOptions: TreeFiltersState): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
87
- const cmp = leafComparatorByTreeSortBy(filterOptions.sortBy);
88
- const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
59
+ export const leafComparator = (sortBy: SortBy = "status,asc"): Comparator<TreeLeaf<AwesomeTreeLeaf>> => {
60
+ const cmp = leafComparatorByTreeSortBy(sortBy);
61
+ const directional = sortBy.split(",")[1] === "asc" ? cmp : reverse(cmp);
89
62
  // apply fallback sorting by name
90
63
  return andThen([directional, compareBy("name", alphabetically())]);
91
64
  };
92
65
 
93
- export const groupComparator = (filterOptions: TreeFiltersState): Comparator<DefaultTreeGroup> => {
94
- const cmp = groupComparatorByTreeSortBy(filterOptions.sortBy);
95
- const directional = filterOptions.direction === "asc" ? cmp : reverse(cmp);
66
+ export const groupComparator = (sortBy: SortBy = "status,asc"): Comparator<DefaultTreeGroup> => {
67
+ const cmp = groupComparatorByTreeSortBy(sortBy);
68
+ const directional = sortBy.split(",")[1] === "asc" ? cmp : reverse(cmp);
96
69
  // apply fallback sorting by name
97
70
  return andThen([directional, compareBy("name", alphabetically())]);
98
71
  };
99
72
 
100
73
  export const filterLeaves = (
101
- leaves: string[] = [],
74
+ leafIds: string[] = [],
102
75
  leavesById: AwesomeTree["leavesById"],
103
- filterOptions: TreeFiltersState,
76
+ filterPredicate: (item: AwesomeTreeLeaf) => boolean,
77
+ sortBy: SortBy = "status,asc",
104
78
  ) => {
105
- const filteredLeaves = [...leaves]
106
- .map((leafId) => leavesById[leafId])
107
- .filter((leaf: TreeLeaf<AwesomeTreeLeaf>) => isIncluded(leaf, filterOptions));
79
+ let leaves = [...leafIds].map((leafId) => leavesById[leafId]);
108
80
 
109
- const comparator = leafComparator(filterOptions);
110
- return filteredLeaves.sort(comparator);
81
+ if (filterPredicate) {
82
+ leaves = leaves.filter(filterPredicate);
83
+ }
84
+
85
+ const comparator = leafComparator(sortBy);
86
+ return leaves.sort(comparator);
111
87
  };
112
88
 
113
89
  /**
@@ -119,12 +95,14 @@ export const createRecursiveTree = (payload: {
119
95
  group: AwesomeTreeGroup;
120
96
  groupsById: AwesomeTree["groupsById"];
121
97
  leavesById: AwesomeTree["leavesById"];
122
- filterOptions?: TreeFiltersState;
98
+ filterPredicate: (item: AwesomeTreeLeaf) => boolean;
99
+ sortBy: SortBy;
123
100
  }): AwesomeRecursiveTree => {
124
- const { group, groupsById, leavesById, filterOptions } = payload;
101
+ const { group, groupsById, leavesById, filterPredicate, sortBy } = payload;
125
102
  const groupLeaves: string[] = group.leaves ?? [];
126
103
 
127
- const leaves = filterLeaves(groupLeaves, leavesById, filterOptions);
104
+ const leaves = filterLeaves(groupLeaves, leavesById, filterPredicate, sortBy);
105
+
128
106
  const trees =
129
107
  group.groups
130
108
  ?.map((groupId) =>
@@ -132,20 +110,24 @@ export const createRecursiveTree = (payload: {
132
110
  group: groupsById[groupId],
133
111
  groupsById,
134
112
  leavesById,
135
- filterOptions,
113
+ filterPredicate,
114
+ sortBy,
136
115
  }),
137
116
  )
138
117
  ?.filter((rt) => !isRecursiveTreeEmpty(rt)) ?? [];
139
118
 
140
119
  const statistic: Statistic = emptyStatistic();
120
+
141
121
  trees.forEach((rt: AwesomeRecursiveTree) => {
142
122
  if (rt.statistic) {
143
123
  const additional: Statistic = rt.statistic;
124
+
144
125
  mergeStatistic(statistic, additional);
145
126
  }
146
127
  });
147
128
  leaves.forEach((leaf) => {
148
129
  const status: TestStatus = leaf.status;
130
+
149
131
  incrementStatistic(statistic, status);
150
132
  });
151
133
 
@@ -153,7 +135,7 @@ export const createRecursiveTree = (payload: {
153
135
  ...group,
154
136
  statistic,
155
137
  leaves,
156
- trees: trees.sort(groupComparator(filterOptions)),
138
+ trees: trees.sort(groupComparator(sortBy)),
157
139
  };
158
140
  };
159
141
 
@@ -1,10 +1,11 @@
1
- import { getReportOptions } from "@allurereport/web-commons";
1
+ import * as webCommons from "@allurereport/web-commons";
2
+ import { signal } from "@preact/signals";
2
3
  import { cleanup, render, screen } from "@testing-library/preact";
3
- import { Mock, beforeEach, describe, expect, it, vi } from "vitest";
4
+ import { beforeEach, describe, expect, it, vi } from "vitest";
4
5
  import { Header } from "@/components/Header";
5
6
  import { CiInfo } from "@/components/Header/CiInfo";
6
- import { route } from "@/stores/router";
7
- import { availableSections } from "@/stores/sections";
7
+ import type * as routerModule from "@/stores/router";
8
+ import { testResultStore } from "@/stores/testResults";
8
9
 
9
10
  const fixtures = {
10
11
  ci: {
@@ -12,64 +13,60 @@ const fixtures = {
12
13
  },
13
14
  };
14
15
 
15
- vi.mock("@allurereport/web-commons", () => ({
16
- getReportOptions: vi.fn().mockReturnValue({}),
17
- }));
18
- vi.mock("@/stores/router", async () => {
19
- const { signal } = await import("@preact/signals");
16
+ // Create a controllable route signal
17
+ const mockRouteParams = signal<{ testResultId?: string; tab?: string }>({});
20
18
 
21
- return {
22
- route: signal({}),
23
- };
24
- });
25
- vi.mock("@/stores/sections", async () => {
26
- const { signal } = await import("@preact/signals");
27
-
28
- return {
29
- availableSections: signal([]),
30
- };
31
- });
19
+ // Mock UI components to simplify tests
32
20
  vi.mock("@/components/HeaderControls", () => ({
33
- HeaderControls: () => <div data-testid="header-controls"></div>,
21
+ HeaderControls: () => <div data-testid="header-controls" />,
34
22
  }));
23
+
35
24
  vi.mock("@/components/SectionPicker", () => ({
36
- SectionPicker: () => <div data-testid="section-picker"></div>,
25
+ SectionPicker: () => <div data-testid="section-picker" />,
37
26
  }));
27
+
38
28
  vi.mock("@/components/TestResult/TrHeader/TrBreadcrumbs", () => ({
39
- TrBreadcrumbs: () => <div data-testid="breadcrumbs"></div>,
29
+ TrBreadcrumbs: () => <div data-testid="breadcrumbs" />,
40
30
  }));
31
+
41
32
  vi.mock("@/components/Header/CiInfo", () => ({
42
- // CiInfo: vi.fn().mockReturnValue(<div data-testid="ci-info"></div>),
43
- CiInfo: vi.fn().mockImplementation(() => <div data-testid="ci-info"></div>),
33
+ CiInfo: vi.fn().mockImplementation(() => <div data-testid="ci-info" />),
44
34
  }));
45
35
 
36
+ // Mock router module with controllable testResultRoute
37
+ vi.mock("@/stores/router", async (importOriginal) => {
38
+ const actual = await importOriginal<typeof routerModule>();
39
+ const { computed: computedFn } = await import("@preact/signals");
40
+
41
+ return {
42
+ ...actual,
43
+ testResultRoute: computedFn(() => {
44
+ const params = mockRouteParams.value;
45
+ const hasTestResultId = params.testResultId !== undefined;
46
+ return {
47
+ matches: hasTestResultId,
48
+ params: params || {},
49
+ };
50
+ }),
51
+ };
52
+ });
53
+
46
54
  beforeEach(() => {
47
55
  vi.clearAllMocks();
48
56
  cleanup();
49
- route.value = {};
50
- availableSections.value = [];
57
+ mockRouteParams.value = {};
58
+ testResultStore.value = {
59
+ loading: false,
60
+ error: undefined,
61
+ data: undefined,
62
+ };
63
+ vi.spyOn(webCommons, "getReportOptions").mockReturnValue({});
51
64
  });
52
65
 
53
66
  describe("components > Header", () => {
54
- it("should render sections picker when there are sections available", () => {
55
- availableSections.value = ["section1", "section2"];
56
-
57
- render(<Header />);
58
-
59
- expect(screen.getByTestId("section-picker")).toBeInTheDocument();
60
- });
61
-
62
- it("shouldn't render sections picker when there are no sections available", () => {
63
- render(<Header />);
64
-
65
- expect(screen.queryByTestId("section-picker")).not.toBeInTheDocument();
66
- });
67
-
68
67
  it("should render ci info only when testResultId route parameter doesn't exists and ci report option is available", () => {
69
- route.value = {
70
- params: {},
71
- };
72
- (getReportOptions as Mock).mockReturnValue({
68
+ mockRouteParams.value = {};
69
+ vi.spyOn(webCommons, "getReportOptions").mockReturnValue({
73
70
  ci: fixtures.ci,
74
71
  });
75
72
 
@@ -80,12 +77,10 @@ describe("components > Header", () => {
80
77
  });
81
78
 
82
79
  it("shouldn't render ci info when testResultId route parameter exists", () => {
83
- route.value = {
84
- params: {
85
- testResultId: "1",
86
- },
80
+ mockRouteParams.value = {
81
+ testResultId: "1",
87
82
  };
88
- (getReportOptions as Mock).mockReturnValue({
83
+ vi.spyOn(webCommons, "getReportOptions").mockReturnValue({
89
84
  ci: fixtures.ci,
90
85
  });
91
86
 
@@ -96,12 +91,10 @@ describe("components > Header", () => {
96
91
  });
97
92
 
98
93
  it("should render breadcrumbs when testResultId route parameter exists", () => {
99
- route.value = {
100
- params: {
101
- testResultId: "1",
102
- },
94
+ mockRouteParams.value = {
95
+ testResultId: "1",
103
96
  };
104
- (getReportOptions as Mock).mockReturnValue({
97
+ vi.spyOn(webCommons, "getReportOptions").mockReturnValue({
105
98
  ci: fixtures.ci,
106
99
  });
107
100
 
@@ -111,9 +104,7 @@ describe("components > Header", () => {
111
104
  });
112
105
 
113
106
  it("shouldn't render breadcrumbs when testResultId route parameter doesn't exists", () => {
114
- route.value = {
115
- params: {},
116
- };
107
+ mockRouteParams.value = {};
117
108
 
118
109
  render(<Header />);
119
110