@oneuptime/common 14.0.2 → 14.0.3
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.
- package/Models/DatabaseModels/AlertFeed.ts +2 -0
- package/Models/DatabaseModels/IncidentAlert.ts +540 -0
- package/Models/DatabaseModels/IncidentFeed.ts +2 -0
- package/Models/DatabaseModels/Index.ts +2 -0
- package/Models/DatabaseModels/Project.ts +60 -0
- package/Models/DatabaseModels/RumApplication.ts +52 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.ts +89 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
- package/Server/Services/IncidentAlertService.ts +1811 -0
- package/Server/Services/IncidentService.ts +210 -10
- package/Server/Services/IncidentStateTimelineService.ts +24 -0
- package/Server/Services/Index.ts +2 -0
- package/Server/Utils/SessionReplay/SessionReplayGateCache.ts +24 -2
- package/Tests/App/Dashboard/BulkIncidentLinkActions.test.tsx +869 -0
- package/Tests/App/Dashboard/CephMetricTooltips.test.tsx +1777 -0
- package/Tests/App/Dashboard/CloudFleetSummary.test.ts +8 -0
- package/Tests/App/Dashboard/CloudMetricTooltips.test.tsx +887 -0
- package/Tests/App/Dashboard/ContainerHostMetricTooltips.test.tsx +1309 -0
- package/Tests/App/Dashboard/DiscoveryScanLivePage.test.tsx +39 -0
- package/Tests/App/Dashboard/DockerSwarmClustersListTooltips.test.tsx +414 -0
- package/Tests/App/Dashboard/DockerSwarmMetricTooltips.test.ts +796 -0
- package/Tests/App/Dashboard/DockerSwarmOverviewTooltips.test.tsx +747 -0
- package/Tests/App/Dashboard/ExceptionMonitorEnvironmentFilter.test.tsx +38 -18
- package/Tests/App/Dashboard/HostDetailViewTooltips.test.tsx +725 -0
- package/Tests/App/Dashboard/HostListColumnTooltips.test.tsx +472 -0
- package/Tests/App/Dashboard/HostMetricTooltips.test.ts +709 -0
- package/Tests/App/Dashboard/HostOverviewTooltips.test.tsx +698 -0
- package/Tests/App/Dashboard/HostTooltipHarness.ts +124 -0
- package/Tests/App/Dashboard/HostsListTooltips.test.tsx +395 -0
- package/Tests/App/Dashboard/IncidentAlertLinkDialog.test.tsx +691 -0
- package/Tests/App/Dashboard/IncidentAlertLinkHelpers.test.ts +458 -0
- package/Tests/App/Dashboard/IncidentAlertLinkPages.test.tsx +828 -0
- package/Tests/App/Dashboard/IncidentAlertLinkSideMenus.test.tsx +231 -0
- package/Tests/App/Dashboard/IncidentCreateFromAlerts.test.tsx +689 -0
- package/Tests/App/Dashboard/IoTMetricTooltips.test.tsx +1123 -0
- package/Tests/App/Dashboard/KubernetesClusterMetricTooltips.test.ts +837 -0
- package/Tests/App/Dashboard/KubernetesClusterOverviewTooltips.test.tsx +699 -0
- package/Tests/App/Dashboard/KubernetesContainersTabTooltips.test.tsx +320 -0
- package/Tests/App/Dashboard/KubernetesCostTooltips.test.tsx +502 -0
- package/Tests/App/Dashboard/KubernetesInsightsTooltips.test.tsx +222 -0
- package/Tests/App/Dashboard/KubernetesResourceMetricTooltips.test.ts +561 -0
- package/Tests/App/Dashboard/KubernetesResourcePagesTooltips.test.tsx +1168 -0
- package/Tests/App/Dashboard/LinkIncidentAlertModal.test.tsx +154 -0
- package/Tests/App/Dashboard/MetricDescriptionRules.ts +170 -0
- package/Tests/App/Dashboard/MetricDescriptionsCatalog.test.ts +206 -0
- package/Tests/App/Dashboard/MetricDescriptionsConsistency.test.ts +275 -0
- package/Tests/App/Dashboard/NetworkDeviceTooltips.test.tsx +852 -0
- package/Tests/App/Dashboard/NetworkDiagnosticsTooltips.test.tsx +556 -0
- package/Tests/App/Dashboard/NetworkMetricTooltips.test.ts +1348 -0
- package/Tests/App/Dashboard/NetworkSiteTooltips.test.tsx +679 -0
- package/Tests/App/Dashboard/ProxmoxMetricTooltips.test.ts +592 -0
- package/Tests/App/Dashboard/ProxmoxOverviewTooltips.test.tsx +1002 -0
- package/Tests/App/Dashboard/ProxmoxResourcePageTooltips.test.tsx +923 -0
- package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +1066 -0
- package/Tests/App/Dashboard/RumOverviewPage.test.tsx +1195 -0
- package/Tests/App/Dashboard/ServerlessMetricTooltips.test.tsx +474 -0
- package/Tests/App/Dashboard/ServiceMetricTooltips.test.tsx +772 -0
- package/Tests/App/Dashboard/SessionReplayAuditTable.test.tsx +56 -1
- package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +1207 -0
- package/Tests/App/Dashboard/TelemetryResourceTabTooltips.test.tsx +437 -0
- package/Tests/App/Dashboard/VMwareMetricTooltips.test.ts +801 -0
- package/Tests/App/Dashboard/VMwareOverviewTooltips.test.tsx +601 -0
- package/Tests/App/Dashboard/VMwareResourcePagesTooltips.test.tsx +646 -0
- package/Tests/App/Dashboard/VMwareTooltipHarness.ts +145 -0
- package/Tests/Models/DatabaseModels/IncidentAlertModel.test.ts +554 -0
- package/Tests/Models/DatabaseModels/SessionReplayModels.test.ts +117 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentAlertMigration.test.ts +341 -0
- package/Tests/Server/Infrastructure/Postgres/AddSessionReplaySameOriginTracePropagationMigration.test.ts +247 -0
- package/Tests/Server/Services/IncidentAlertPostgres.test.ts +903 -0
- package/Tests/Server/Services/IncidentAlertRegistration.test.ts +96 -0
- package/Tests/Server/Services/IncidentAlertService.test.ts +2225 -0
- package/Tests/Server/Services/IncidentAlertStateCascade.test.ts +970 -0
- package/Tests/Server/Services/IncidentCreateFromAlerts.test.ts +1284 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayGateCachePolicy.test.ts +103 -0
- package/Tests/Types/Rum/WebVitals.test.ts +173 -0
- package/Tests/UI/Components/FieldLabelInfoCardTooltip.test.tsx +413 -0
- package/Tests/UI/Components/InfoTooltip.test.tsx +242 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +207 -3
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDeleteVerb.test.tsx +367 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableCreateButtonTitle.test.tsx +275 -0
- package/Tests/UI/Components/TableHeaderTooltip.test.tsx +662 -0
- package/Tests/UI/Rum/PrivacySummaryCard.test.tsx +166 -9
- package/Tests/UI/Rum/RecordingHealthTooltips.test.tsx +447 -0
- package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +164 -0
- package/Tests/UI/Rum/ReplayFrameCapture.test.ts +6750 -0
- package/Tests/UI/Rum/ReplayRail.test.tsx +723 -12
- package/Tests/UI/Rum/ReplayRailDetail.test.tsx +86 -0
- package/Tests/UI/Rum/ReplayScreenshot.test.ts +2124 -0
- package/Tests/UI/Rum/ReplayScreenshotActions.test.tsx +3288 -0
- package/Tests/UI/Rum/ReplayStage.test.tsx +62 -0
- package/Tests/UI/Rum/ReplayStageOverlays.test.tsx +983 -2
- package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +149 -0
- package/Tests/UI/Rum/SessionReplaySetupGuide.test.tsx +107 -6
- package/Tests/UI/Rum/SessionReplayUsersTableTooltips.test.tsx +330 -0
- package/Tests/UI/Rum/UserFlowTooltips.test.tsx +886 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +10 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +2 -0
- package/Tests/UI/Utils/PermissionGate.test.ts +76 -0
- package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +696 -0
- package/Tests/Utils/Rum/SessionTraceState.test.ts +239 -0
- package/Types/Incident/IncidentAlertLink.ts +38 -0
- package/Types/Permission.ts +48 -0
- package/Types/Rum/SessionReplay.ts +25 -6
- package/Types/Rum/WebVitals.ts +52 -0
- package/UI/Components/Detail/FieldLabel.tsx +8 -0
- package/UI/Components/InfoCard/InfoCard.tsx +47 -1
- package/UI/Components/ModelTable/BaseModelTable.tsx +95 -17
- package/UI/Components/ModelTable/Column.ts +5 -0
- package/UI/Components/Table/TableHeader.tsx +47 -2
- package/UI/Components/Table/Types/Column.ts +7 -0
- package/UI/Components/Tooltip/InfoTooltip.tsx +78 -0
- package/UI/Utils/PermissionGate.ts +11 -2
- package/Utils/Incident/IncidentFromAlerts.ts +516 -0
- package/Utils/Rum/SessionTraceState.ts +212 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentAlert.js +553 -0
- package/build/dist/Models/DatabaseModels/IncidentAlert.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +62 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js +53 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js +42 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/IncidentAlertService.js +1370 -0
- package/build/dist/Server/Services/IncidentAlertService.js.map +1 -0
- package/build/dist/Server/Services/IncidentService.js +164 -12
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +21 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js +8 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js.map +1 -1
- package/build/dist/Types/Incident/IncidentAlertLink.js +34 -0
- package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -0
- package/build/dist/Types/Permission.js +42 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Rum/WebVitals.js +25 -0
- package/build/dist/Types/Rum/WebVitals.js.map +1 -1
- package/build/dist/UI/Components/Detail/FieldLabel.js +2 -0
- package/build/dist/UI/Components/Detail/FieldLabel.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +22 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +66 -14
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +18 -2
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js +28 -0
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js.map +1 -0
- package/build/dist/UI/Utils/PermissionGate.js +4 -2
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/build/dist/Utils/Incident/IncidentFromAlerts.js +306 -0
- package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -0
- package/build/dist/Utils/Rum/SessionTraceState.js +154 -0
- package/build/dist/Utils/Rum/SessionTraceState.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterEach,
|
|
3
|
+
beforeEach,
|
|
4
|
+
describe,
|
|
5
|
+
expect,
|
|
6
|
+
jest,
|
|
7
|
+
test,
|
|
8
|
+
} from "@jest/globals";
|
|
9
|
+
import "@testing-library/jest-dom";
|
|
10
|
+
import { cleanup } from "@testing-library/react";
|
|
11
|
+
import React from "react";
|
|
12
|
+
import AlertSideMenu from "../../../../App/FeatureSet/Dashboard/src/Pages/Alerts/View/SideMenu";
|
|
13
|
+
import IncidentSideMenu from "../../../../App/FeatureSet/Dashboard/src/Pages/Incidents/View/SideMenu";
|
|
14
|
+
import PageMap from "../../../../App/FeatureSet/Dashboard/src/Utils/PageMap";
|
|
15
|
+
import RouteMap, {
|
|
16
|
+
RouteUtil,
|
|
17
|
+
} from "../../../../App/FeatureSet/Dashboard/src/Utils/RouteMap";
|
|
18
|
+
import Route from "../../../Types/API/Route";
|
|
19
|
+
import ObjectID from "../../../Types/ObjectID";
|
|
20
|
+
import {
|
|
21
|
+
DESKTOP_WIDTH,
|
|
22
|
+
MenuLink,
|
|
23
|
+
PROJECT_ID,
|
|
24
|
+
goTo,
|
|
25
|
+
hrefsInMenu,
|
|
26
|
+
isExpanded,
|
|
27
|
+
linksIn,
|
|
28
|
+
renderMenu,
|
|
29
|
+
sectionRoot,
|
|
30
|
+
sectionTitlesInOrder,
|
|
31
|
+
setViewportWidth,
|
|
32
|
+
} from "./SideMenuHarness";
|
|
33
|
+
|
|
34
|
+
jest.mock("react-i18next", () => {
|
|
35
|
+
return {
|
|
36
|
+
useTranslation: () => {
|
|
37
|
+
return {
|
|
38
|
+
t: (value: string): string => {
|
|
39
|
+
return value;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* The "Linked Alerts" page of an incident and the "Linked Incidents" page of
|
|
48
|
+
* an alert are reached from the record's side menu. Both items go into an
|
|
49
|
+
* existing section - the incident menu's sections are pinned by
|
|
50
|
+
* ResourceAuditLogsSideMenus.test.tsx - and each must light up, with its
|
|
51
|
+
* section expanded, when its page is open.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
const MODEL_ID: ObjectID = new ObjectID("0193c0de-3333-4aaa-8bbb-000000000003");
|
|
55
|
+
|
|
56
|
+
function pageRoute(page: PageMap): string {
|
|
57
|
+
return RouteUtil.populateRouteParams(RouteMap[page] as Route, {
|
|
58
|
+
modelId: MODEL_ID,
|
|
59
|
+
}).toString();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface ExpectedLink {
|
|
63
|
+
title: string;
|
|
64
|
+
page: PageMap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function expectedLinks(links: Array<ExpectedLink>): Array<MenuLink> {
|
|
68
|
+
return links.map((link: ExpectedLink): MenuLink => {
|
|
69
|
+
return { title: link.title, href: pageRoute(link.page) };
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function activeAnchorIn(section: string, href: string): HTMLAnchorElement {
|
|
74
|
+
const anchor: HTMLAnchorElement | undefined = Array.from(
|
|
75
|
+
sectionRoot(section).querySelectorAll<HTMLAnchorElement>("a"),
|
|
76
|
+
).find((candidate: HTMLAnchorElement): boolean => {
|
|
77
|
+
return candidate.getAttribute("href") === href;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (!anchor) {
|
|
81
|
+
throw new Error(`No link to ${href} in the ${section} section.`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return anchor;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
beforeEach(() => {
|
|
88
|
+
setViewportWidth(DESKTOP_WIDTH);
|
|
89
|
+
goTo(`/dashboard/${PROJECT_ID}`);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
afterEach(() => {
|
|
93
|
+
cleanup();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe("the incident view side menu", () => {
|
|
97
|
+
test("keeps its sections exactly as they were", async () => {
|
|
98
|
+
goTo(pageRoute(PageMap.INCIDENT_VIEW_ALERTS));
|
|
99
|
+
await renderMenu(<IncidentSideMenu modelId={MODEL_ID} />);
|
|
100
|
+
|
|
101
|
+
expect(sectionTitlesInOrder()).toEqual([
|
|
102
|
+
"Overview",
|
|
103
|
+
"Investigation",
|
|
104
|
+
"Team",
|
|
105
|
+
"Notifications",
|
|
106
|
+
"Notes",
|
|
107
|
+
"Advanced",
|
|
108
|
+
]);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("lists Linked Alerts at the end of Investigation", async () => {
|
|
112
|
+
goTo(pageRoute(PageMap.INCIDENT_VIEW));
|
|
113
|
+
await renderMenu(<IncidentSideMenu modelId={MODEL_ID} />);
|
|
114
|
+
|
|
115
|
+
expect(linksIn("Investigation")).toEqual(
|
|
116
|
+
expectedLinks([
|
|
117
|
+
{ title: "Description", page: PageMap.INCIDENT_VIEW_DESCRIPTION },
|
|
118
|
+
{ title: "Root Cause", page: PageMap.INCIDENT_VIEW_ROOT_CAUSE },
|
|
119
|
+
{ title: "Remediation", page: PageMap.INCIDENT_VIEW_REMEDIATION },
|
|
120
|
+
{ title: "Runbooks", page: PageMap.INCIDENT_VIEW_RUNBOOKS },
|
|
121
|
+
{ title: "Postmortem", page: PageMap.INCIDENT_VIEW_POSTMORTEM },
|
|
122
|
+
{ title: "Linked Alerts", page: PageMap.INCIDENT_VIEW_ALERTS },
|
|
123
|
+
]),
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("leaves the pinned Advanced section alone", async () => {
|
|
128
|
+
goTo(pageRoute(PageMap.INCIDENT_VIEW));
|
|
129
|
+
await renderMenu(<IncidentSideMenu modelId={MODEL_ID} />);
|
|
130
|
+
|
|
131
|
+
expect(linksIn("Advanced")).toEqual(
|
|
132
|
+
expectedLinks([
|
|
133
|
+
{ title: "Custom Fields", page: PageMap.INCIDENT_VIEW_CUSTOM_FIELDS },
|
|
134
|
+
{ title: "Settings", page: PageMap.INCIDENT_VIEW_SETTINGS },
|
|
135
|
+
{ title: "Audit Logs", page: PageMap.INCIDENT_VIEW_AUDIT_LOGS },
|
|
136
|
+
{ title: "Delete Incident", page: PageMap.INCIDENT_VIEW_DELETE },
|
|
137
|
+
]),
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("marks Linked Alerts active on its page and expands Investigation", async () => {
|
|
142
|
+
const linkedAlerts: string = pageRoute(PageMap.INCIDENT_VIEW_ALERTS);
|
|
143
|
+
|
|
144
|
+
goTo(linkedAlerts);
|
|
145
|
+
await renderMenu(<IncidentSideMenu modelId={MODEL_ID} />);
|
|
146
|
+
|
|
147
|
+
expect(linkedAlerts).toBe(
|
|
148
|
+
`/dashboard/${PROJECT_ID}/incidents/${MODEL_ID.toString()}/alerts`,
|
|
149
|
+
);
|
|
150
|
+
expect(activeAnchorIn("Investigation", linkedAlerts)).toHaveClass(
|
|
151
|
+
"bg-indigo-50",
|
|
152
|
+
"text-indigo-700",
|
|
153
|
+
);
|
|
154
|
+
expect(isExpanded("Investigation")).toBe(true);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test("links every page once, fully populated", async () => {
|
|
158
|
+
goTo(pageRoute(PageMap.INCIDENT_VIEW_ALERTS));
|
|
159
|
+
await renderMenu(<IncidentSideMenu modelId={MODEL_ID} />);
|
|
160
|
+
|
|
161
|
+
const hrefs: Array<string> = hrefsInMenu();
|
|
162
|
+
|
|
163
|
+
expect(hrefs).toEqual(Array.from(new Set(hrefs)));
|
|
164
|
+
hrefs.forEach((href: string) => {
|
|
165
|
+
expect(href).not.toContain(":projectId");
|
|
166
|
+
expect(href).not.toContain(":modelId");
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
describe("the alert view side menu", () => {
|
|
172
|
+
test("keeps its sections", async () => {
|
|
173
|
+
goTo(pageRoute(PageMap.ALERT_VIEW_INCIDENTS));
|
|
174
|
+
await renderMenu(<AlertSideMenu modelId={MODEL_ID} />);
|
|
175
|
+
|
|
176
|
+
expect(sectionTitlesInOrder()).toEqual([
|
|
177
|
+
"Basic",
|
|
178
|
+
"On Call",
|
|
179
|
+
"Logs",
|
|
180
|
+
"Alert Notes",
|
|
181
|
+
"Advanced",
|
|
182
|
+
]);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test("lists Linked Incidents at the end of Basic", async () => {
|
|
186
|
+
goTo(pageRoute(PageMap.ALERT_VIEW));
|
|
187
|
+
await renderMenu(<AlertSideMenu modelId={MODEL_ID} />);
|
|
188
|
+
|
|
189
|
+
expect(linksIn("Basic")).toEqual(
|
|
190
|
+
expectedLinks([
|
|
191
|
+
{ title: "Overview", page: PageMap.ALERT_VIEW },
|
|
192
|
+
{ title: "Description", page: PageMap.ALERT_VIEW_DESCRIPTION },
|
|
193
|
+
{ title: "Root Cause", page: PageMap.ALERT_VIEW_ROOT_CAUSE },
|
|
194
|
+
{ title: "Remediation", page: PageMap.ALERT_VIEW_REMEDIATION },
|
|
195
|
+
{ title: "Runbooks", page: PageMap.ALERT_VIEW_RUNBOOKS },
|
|
196
|
+
{ title: "State Timeline", page: PageMap.ALERT_VIEW_STATE_TIMELINE },
|
|
197
|
+
{ title: "Owners", page: PageMap.ALERT_VIEW_OWNERS },
|
|
198
|
+
{ title: "Linked Incidents", page: PageMap.ALERT_VIEW_INCIDENTS },
|
|
199
|
+
]),
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test("marks Linked Incidents active on its page and expands Basic", async () => {
|
|
204
|
+
const linkedIncidents: string = pageRoute(PageMap.ALERT_VIEW_INCIDENTS);
|
|
205
|
+
|
|
206
|
+
goTo(linkedIncidents);
|
|
207
|
+
await renderMenu(<AlertSideMenu modelId={MODEL_ID} />);
|
|
208
|
+
|
|
209
|
+
expect(linkedIncidents).toBe(
|
|
210
|
+
`/dashboard/${PROJECT_ID}/alerts/${MODEL_ID.toString()}/incidents`,
|
|
211
|
+
);
|
|
212
|
+
expect(activeAnchorIn("Basic", linkedIncidents)).toHaveClass(
|
|
213
|
+
"bg-indigo-50",
|
|
214
|
+
"text-indigo-700",
|
|
215
|
+
);
|
|
216
|
+
expect(isExpanded("Basic")).toBe(true);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
test("links every page once, fully populated", async () => {
|
|
220
|
+
goTo(pageRoute(PageMap.ALERT_VIEW_INCIDENTS));
|
|
221
|
+
await renderMenu(<AlertSideMenu modelId={MODEL_ID} />);
|
|
222
|
+
|
|
223
|
+
const hrefs: Array<string> = hrefsInMenu();
|
|
224
|
+
|
|
225
|
+
expect(hrefs).toEqual(Array.from(new Set(hrefs)));
|
|
226
|
+
hrefs.forEach((href: string) => {
|
|
227
|
+
expect(href).not.toContain(":projectId");
|
|
228
|
+
expect(href).not.toContain(":modelId");
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
});
|