@localstack/appinspector-ui 1.0.82 → 1.0.84

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/dist/index.js CHANGED
@@ -10209,6 +10209,36 @@ var ResponsiveTimestampCell = memo2(({ date, locale }) => {
10209
10209
  return /* @__PURE__ */ jsx2("div", { style: { width: "100%" }, children: formattedTime });
10210
10210
  });
10211
10211
 
10212
+ // src/constants/test-ids.ts
10213
+ var EVENT_DETAILS_TEST_ID = "event-details";
10214
+ var CLEAR_SPANS_TEST_ID = "clear-spans";
10215
+ var SPANS_DATA_GRID_TEST_ID = "spans-data-grid";
10216
+ var TRACE_GRAPH_TEST_ID = "trace-graph";
10217
+ var SPANS_LIST_PAGE_TEST_ID = "spans-list-page";
10218
+ var TRACE_GRAPH_PAGE_TEST_ID = "trace-graph-page";
10219
+ var VIEW_SPAN_DETAILS_TEST_ID = "view-span-details";
10220
+ var SPANS_DATA_GRID_ROW_TEST_ID = "spans-data-grid-row";
10221
+ var EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID = "event-details-section-basic-information";
10222
+ var EVENT_DETAILS_SERVICE_NAME_TEST_ID = "event-details-service-name";
10223
+ var EVENT_DETAILS_OPERATION_NAME_TEST_ID = "event-details-operation-name";
10224
+ var EVENT_DETAILS_CLOSE_BUTTON_TEST_ID = "event-details-close-button";
10225
+ var EVENT_DETAILS_STATUS_TEST_ID = "event-details-status";
10226
+ var EVENT_DETAILS_RESOURCE_NAME_TEST_ID = "event-details-resource-name";
10227
+ var EVENT_DETAILS_RESOURCE_ARN_TEST_ID = "event-details-resource-arn";
10228
+ var EVENT_DETAILS_ACCOUNT_TEST_ID = "event-details-account";
10229
+ var EVENT_DETAILS_REGION_TEST_ID = "event-details-region";
10230
+ var EVENT_DETAILS_START_TIME_TEST_ID = "event-details-start-time";
10231
+ var EVENT_DETAILS_DURATION_TEST_ID = "event-details-duration";
10232
+ var EVENT_DETAILS_SPAN_ID_TEST_ID = "event-details-span-id";
10233
+ var EVENT_DETAILS_TRACE_ID_TEST_ID = "event-details-trace-id";
10234
+ var EVENT_DETAILS_REQUEST_ID_TEST_ID = "event-details-request-id";
10235
+ var EVENT_DETAILS_REQUEST_PAYLOAD = "event-details-request-payload";
10236
+ var EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID = "event-details-response-payload";
10237
+ var EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID = "event-details-exception-payload";
10238
+ var SERVICE_NODE_TEST_ID = "service-node";
10239
+ var SERVICE_NODE_SERVICE_NAME_TEST_ID = "service-node-service-name";
10240
+ var SERVICE_NODE_OPERATION_NAME_TEST_ID = "service-node-operation-name";
10241
+
10212
10242
  // src/components/cells/service-cell.tsx
10213
10243
  import { Box as Box2, Divider, Typography, useTheme } from "@mui/material";
10214
10244
  import { memo as memo7 } from "react";
@@ -12659,6 +12689,7 @@ var ServiceCell = memo7(({
12659
12689
  /* @__PURE__ */ jsx124(
12660
12690
  Typography,
12661
12691
  {
12692
+ "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID,
12662
12693
  sx: {
12663
12694
  borderBottomRightRadius: "15px",
12664
12695
  borderTopRightRadius: "15px",
@@ -12835,6 +12866,7 @@ var SpansDataGridRow = memo8(
12835
12866
  backgroundColor: theme.palette.mode === "light" ? newSpanBackgroundColor.light.to : newSpanBackgroundColor.dark.to
12836
12867
  },
12837
12868
  component: motion.tr,
12869
+ "data-testid": SPANS_DATA_GRID_ROW_TEST_ID,
12838
12870
  initial: {
12839
12871
  backgroundColor: theme.palette.mode === "light" ? newSpanBackgroundColor.light.from : newSpanBackgroundColor.dark.from
12840
12872
  },
@@ -12967,6 +12999,7 @@ var SpansDataGrid = ({
12967
12999
  return /* @__PURE__ */ jsx126(Box4, { sx: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx126(
12968
13000
  Button2,
12969
13001
  {
13002
+ "data-testid": VIEW_SPAN_DETAILS_TEST_ID,
12970
13003
  onClick: () => {
12971
13004
  onSpanClick(props.row.original);
12972
13005
  },
@@ -13015,9 +13048,10 @@ var SpansDataGrid = ({
13015
13048
  control: /* @__PURE__ */ jsx126(
13016
13049
  Button2,
13017
13050
  {
13051
+ "data-testid": CLEAR_SPANS_TEST_ID,
13018
13052
  onClick: onClearSpans,
13019
13053
  startIcon: /* @__PURE__ */ jsx126(DeleteForeverOutlined, {}),
13020
- children: "Clear Spans"
13054
+ children: "Clear Events"
13021
13055
  }
13022
13056
  ),
13023
13057
  disabled: clearingSpans,
@@ -13102,7 +13136,7 @@ var SpansDataGrid = ({
13102
13136
  // src/components/spans-list/spans-list.tsx
13103
13137
  import { jsx as jsx127, jsxs as jsxs122 } from "react/jsx-runtime";
13104
13138
  var SpansList = (props) => {
13105
- return /* @__PURE__ */ jsxs122(Box5, { "data-testid": "spans-data-grid", sx: { display: "flex", flexDirection: "column", flexGrow: 1, gap: 2, width: "100%" }, children: [
13139
+ return /* @__PURE__ */ jsxs122(Box5, { "data-testid": SPANS_DATA_GRID_TEST_ID, sx: { display: "flex", flexDirection: "column", flexGrow: 1, gap: 2, width: "100%" }, children: [
13106
13140
  props.fetchError && /* @__PURE__ */ jsxs122(
13107
13141
  Alert,
13108
13142
  {
@@ -26515,7 +26549,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26515
26549
  const exceptionPayload = tryParseJson(selectedEvent.attributes?.["localstack.aws.service.exception"]);
26516
26550
  const hasPayloads = requestPayload !== void 0 || responsePayload !== void 0 || exceptionPayload !== void 0;
26517
26551
  const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
26518
- return /* @__PURE__ */ jsxs130(Box14, { "data-testid": "event-details", sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
26552
+ return /* @__PURE__ */ jsxs130(Box14, { "data-testid": EVENT_DETAILS_TEST_ID, sx: { display: "flex", flexDirection: "column", height: "100%" }, children: [
26519
26553
  /* @__PURE__ */ jsxs130(
26520
26554
  Box14,
26521
26555
  {
@@ -26530,48 +26564,48 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26530
26564
  },
26531
26565
  children: [
26532
26566
  /* @__PURE__ */ jsx137(Box14, { children: /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "h6", children: "Operation Details" }) }),
26533
- onClose && /* @__PURE__ */ jsx137(IconButton4, { onClick: onClose, size: "small", children: /* @__PURE__ */ jsx137(Close2, {}) })
26567
+ onClose && /* @__PURE__ */ jsx137(IconButton4, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx137(Close2, {}) })
26534
26568
  ]
26535
26569
  }
26536
26570
  ),
26537
26571
  /* @__PURE__ */ jsx137(Box14, { sx: { flexGrow: 1, overflow: "auto", p: 2 }, children: /* @__PURE__ */ jsxs130(Stack2, { spacing: 2, children: [
26538
- /* @__PURE__ */ jsx137(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs130(Stack2, { spacing: 1, children: [
26572
+ /* @__PURE__ */ jsx137(ToggleSection, { headline: "Basic Information", children: /* @__PURE__ */ jsxs130(Stack2, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
26539
26573
  /* @__PURE__ */ jsxs130(Box14, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
26540
26574
  /* @__PURE__ */ jsxs130(Box14, { children: [
26541
26575
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Service" }),
26542
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.service_name })
26576
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_SERVICE_NAME_TEST_ID, variant: "body2", children: selectedEvent.service_name })
26543
26577
  ] }),
26544
26578
  /* @__PURE__ */ jsxs130(Box14, { children: [
26545
26579
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Operation" }),
26546
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.operation_name })
26580
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_OPERATION_NAME_TEST_ID, variant: "body2", children: selectedEvent.operation_name })
26547
26581
  ] })
26548
26582
  ] }),
26549
26583
  /* @__PURE__ */ jsxs130(Box14, { children: [
26550
26584
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource" }),
26551
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.resource_name })
26585
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_RESOURCE_NAME_TEST_ID, variant: "body2", children: selectedEvent.resource_name })
26552
26586
  ] }),
26553
26587
  Boolean(resourceArn) && /* @__PURE__ */ jsxs130(Box14, { children: [
26554
26588
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Resource ARN" }),
26555
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: resourceArn })
26589
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_RESOURCE_ARN_TEST_ID, variant: "body2", children: resourceArn })
26556
26590
  ] }),
26557
26591
  /* @__PURE__ */ jsxs130(Box14, { sx: { display: "grid", gap: 1, gridTemplateColumns: "1.3fr 1fr" }, children: [
26558
26592
  /* @__PURE__ */ jsxs130(Box14, { children: [
26559
26593
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Account" }),
26560
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.account_id })
26594
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_ACCOUNT_TEST_ID, variant: "body2", children: selectedEvent.account_id })
26561
26595
  ] }),
26562
26596
  /* @__PURE__ */ jsxs130(Box14, { children: [
26563
26597
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Region" }),
26564
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.region })
26598
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_REGION_TEST_ID, variant: "body2", children: selectedEvent.region })
26565
26599
  ] })
26566
26600
  ] }),
26567
26601
  /* @__PURE__ */ jsxs130(Box14, { sx: { display: "grid", gap: 1, gridTemplateColumns: duration === void 0 ? "1fr" : "1.3fr 1fr" }, children: [
26568
26602
  /* @__PURE__ */ jsxs130(Box14, { children: [
26569
26603
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Start Time" }),
26570
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
26604
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_START_TIME_TEST_ID, variant: "body2", children: unixNanoToDate(selectedEvent.start_time_unix_nano)?.toISOString() })
26571
26605
  ] }),
26572
26606
  duration !== void 0 && /* @__PURE__ */ jsxs130(Box14, { children: [
26573
26607
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Duration" }),
26574
- /* @__PURE__ */ jsxs130(Typography10, { variant: "body2", children: [
26608
+ /* @__PURE__ */ jsxs130(Typography10, { "data-testid": EVENT_DETAILS_DURATION_TEST_ID, variant: "body2", children: [
26575
26609
  duration,
26576
26610
  "ms"
26577
26611
  ] })
@@ -26583,6 +26617,7 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26583
26617
  Chip3,
26584
26618
  {
26585
26619
  color: selectedEvent.status_code === 2 ? "error" : selectedEvent.status_code === 1 ? "success" : "default",
26620
+ "data-testid": EVENT_DETAILS_STATUS_TEST_ID,
26586
26621
  label: selectedEvent.status_code === 2 ? "Error" : selectedEvent.status_code === 1 ? "OK" : "Unset",
26587
26622
  size: "small"
26588
26623
  }
@@ -26615,15 +26650,15 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26615
26650
  children: /* @__PURE__ */ jsxs130(Stack2, { spacing: 2, children: [
26616
26651
  requestPayload !== void 0 && /* @__PURE__ */ jsxs130(Box14, { children: [
26617
26652
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Request" }),
26618
- /* @__PURE__ */ jsx137(PayloadViewer, { value: requestPayload })
26653
+ /* @__PURE__ */ jsx137(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
26619
26654
  ] }),
26620
26655
  responsePayload !== void 0 && /* @__PURE__ */ jsxs130(Box14, { children: [
26621
26656
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Response" }),
26622
- /* @__PURE__ */ jsx137(PayloadViewer, { value: responsePayload })
26657
+ /* @__PURE__ */ jsx137(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
26623
26658
  ] }),
26624
26659
  exceptionPayload !== void 0 && /* @__PURE__ */ jsxs130(Box14, { children: [
26625
26660
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Exception" }),
26626
- /* @__PURE__ */ jsx137(PayloadViewer, { value: exceptionPayload })
26661
+ /* @__PURE__ */ jsx137(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
26627
26662
  ] })
26628
26663
  ] })
26629
26664
  }
@@ -26646,24 +26681,24 @@ var EventDetails = ({ onClose, selectedEvent }) => {
26646
26681
  /* @__PURE__ */ jsx137(ToggleSection, { headline: "Advanced Information", initialOpen: false, children: /* @__PURE__ */ jsxs130(Stack2, { spacing: 1, children: [
26647
26682
  /* @__PURE__ */ jsxs130(Box14, { children: [
26648
26683
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Span ID" }),
26649
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.span_id })
26684
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_SPAN_ID_TEST_ID, variant: "body2", children: selectedEvent.span_id })
26650
26685
  ] }),
26651
26686
  /* @__PURE__ */ jsxs130(Box14, { children: [
26652
26687
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Trace ID" }),
26653
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: selectedEvent.trace_id })
26688
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_TRACE_ID_TEST_ID, variant: "body2", children: selectedEvent.trace_id })
26654
26689
  ] }),
26655
26690
  requestId !== void 0 && /* @__PURE__ */ jsxs130(Box14, { children: [
26656
26691
  /* @__PURE__ */ jsx137(Typography10, { sx: { fontWeight: 600 }, variant: "caption", children: "Request ID" }),
26657
- /* @__PURE__ */ jsx137(Typography10, { variant: "body2", children: requestId })
26692
+ /* @__PURE__ */ jsx137(Typography10, { "data-testid": EVENT_DETAILS_REQUEST_ID_TEST_ID, variant: "body2", children: requestId })
26658
26693
  ] }),
26659
26694
  eventGroups.info && /* @__PURE__ */ jsx137(EventDetail, { displayText: "Info", events: eventGroups.info, type: "info" })
26660
26695
  ] }) })
26661
26696
  ] }) })
26662
26697
  ] });
26663
26698
  };
26664
- var PayloadViewer = memo10(({ value }) => {
26699
+ var PayloadViewer = memo10(({ testId, value }) => {
26665
26700
  const theme = useTheme3();
26666
- return /* @__PURE__ */ jsx137(Box14, { sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1 }, children: /* @__PURE__ */ jsx137(
26701
+ return /* @__PURE__ */ jsx137(Box14, { "data-testid": testId, sx: { backgroundColor: "background.default", borderRadius: 1, fontSize: 12, overflow: "auto", p: 1 }, children: /* @__PURE__ */ jsx137(
26667
26702
  JsonViewer,
26668
26703
  {
26669
26704
  displayDataTypes: false,
@@ -26748,7 +26783,7 @@ var handleStyle = {
26748
26783
  };
26749
26784
  var ServiceNode = memo11(({ data, selected }) => {
26750
26785
  const hasErrors = (data.event.errors && data.event.errors.length > 0) ?? false;
26751
- return /* @__PURE__ */ jsxs131(Box16, { sx: { maxWidth: 200 }, children: [
26786
+ return /* @__PURE__ */ jsxs131(Box16, { "data-testid": SERVICE_NODE_TEST_ID, sx: { maxWidth: 200 }, children: [
26752
26787
  /* @__PURE__ */ jsxs131(
26753
26788
  Box16,
26754
26789
  {
@@ -26811,6 +26846,7 @@ var ServiceNode = memo11(({ data, selected }) => {
26811
26846
  /* @__PURE__ */ jsx139(
26812
26847
  Typography11,
26813
26848
  {
26849
+ "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID,
26814
26850
  sx: {
26815
26851
  fontSize: "0.9rem",
26816
26852
  maxWidth: "100%",
@@ -27012,7 +27048,7 @@ var TraceGraph = ({
27012
27048
  /* @__PURE__ */ jsxs133(
27013
27049
  ReactFlow,
27014
27050
  {
27015
- "data-testid": "trace-graph",
27051
+ "data-testid": TRACE_GRAPH_TEST_ID,
27016
27052
  edges,
27017
27053
  fitView: true,
27018
27054
  fitViewOptions: initialFocusEventId ? { maxZoom: 1, nodes: [{ id: initialFocusEventId }], padding: 0.2 } : void 0,
@@ -27094,7 +27130,7 @@ var TraceGraphView = ({
27094
27130
  return /* @__PURE__ */ jsxs134(
27095
27131
  Box18,
27096
27132
  {
27097
- "data-testid": "trace-graph-page",
27133
+ "data-testid": TRACE_GRAPH_PAGE_TEST_ID,
27098
27134
  sx: {
27099
27135
  alignItems: "center",
27100
27136
  display: "flex",
@@ -27311,7 +27347,7 @@ var SpansListPage = () => {
27311
27347
  /* @__PURE__ */ jsx143(
27312
27348
  Box19,
27313
27349
  {
27314
- "data-testid": "spans-list-page",
27350
+ "data-testid": SPANS_LIST_PAGE_TEST_ID,
27315
27351
  sx: {
27316
27352
  alignItems: "center",
27317
27353
  display: "flex",