-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
André Santos
committed
Sep 26, 2023
1 parent
89646fd
commit ccc76d0
Showing
6 changed files
with
106 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/components/Run/RunningStatus/OverviewMetrics/__snapshots__/OverviewMetrics.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`OverviewMetrics should render OverviewMetrics component 1`] = `"<div><div class=\\"ant-row ant-row-center ant-row-middle\\" style=\\"align-self: center;\\"><div class=\\"ant-spin ant-spin-spinning\\"><span role=\\"img\\" aria-label=\\"loading\\" style=\\"font-size: 64px;\\" class=\\"anticon anticon-loading anticon-spin ant-spin-dot\\"><svg viewBox=\\"0 0 1024 1024\\" focusable=\\"false\\" data-icon=\\"loading\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\\"></path></svg></span></div></div></div>"`; | ||
exports[`OverviewMetrics should render OverviewMetrics component 1`] = `"<div><div style=\\"border: 1px solid #fff;\\"><div class=\\"ant-descriptions\\"><div class=\\"ant-descriptions-view\\"><table><tbody><tr class=\\"ant-descriptions-row\\"><td class=\\"ant-descriptions-item\\" style=\\"flex-wrap: wrap;\\" colspan=\\"3\\"><div class=\\"ant-descriptions-item-container\\"><span class=\\"ant-descriptions-item-content\\"><div class=\\"ant-statistic\\" style=\\"border: 1px solid #ffd166; border-radius: 10px; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); flex: 1 1 auto; margin: 8px; text-align: center; padding: 5px;\\"><div class=\\"ant-statistic-title\\">Average Latency</div><div class=\\"ant-statistic-content\\"><span class=\\"ant-statistic-content-value\\"><span class=\\"ant-statistic-content-value-int\\">52</span><span class=\\"ant-statistic-content-value-decimal\\">.50</span></span><span class=\\"ant-statistic-content-suffix\\">ms</span></div></div><div class=\\"ant-statistic\\" style=\\"border: 1px solid #ffab40; border-radius: 10px; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); flex: 1 1 auto; margin: 8px; text-align: center; padding: 5px;\\"><div class=\\"ant-statistic-title\\">90% Latency</div><div class=\\"ant-statistic-content\\"><span class=\\"ant-statistic-content-value\\"><span class=\\"ant-statistic-content-value-int\\">62</span><span class=\\"ant-statistic-content-value-decimal\\">.50</span></span><span class=\\"ant-statistic-content-suffix\\">ms</span></div></div><div class=\\"ant-statistic\\" style=\\"border: 1px solid #ff6b6b; border-radius: 10px; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); flex: 1 1 auto; margin: 8px; text-align: center; padding: 5px;\\"><div class=\\"ant-statistic-title\\">Errors</div><div class=\\"ant-statistic-content\\"><span class=\\"ant-statistic-content-value\\"><span class=\\"ant-statistic-content-value-int\\">22</span><span class=\\"ant-statistic-content-value-decimal\\">.86</span></span><span class=\\"ant-statistic-content-suffix\\">%</span></div></div><div class=\\"ant-statistic\\" style=\\"border: 1px solid #64b5f6; border-radius: 10px; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); flex: 1 1 auto; margin: 8px; text-align: center; padding: 5px;\\"><div class=\\"ant-statistic-title\\">Average RPM</div><div class=\\"ant-statistic-content\\"><span class=\\"ant-statistic-content-value\\"><span class=\\"ant-statistic-content-value-int\\">55</span></span><span class=\\"ant-statistic-content-suffix\\">req/min</span></div></div></span></div></td></tr></tbody></table></div></div></div></div>"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/src/components/Run/RunningStatus/ResponseCodes/__snapshots__/ResponseCodes.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ResponseCodes should render ResponseCodes component 1`] = `"<div><div><h3>Error Codes ( Filter applied: < 100 and > 400 )</h3></div><div class=\\"ant-row ant-row-center ant-row-middle\\" style=\\"align-self: center;\\"><div class=\\"ant-spin ant-spin-spinning\\"><span role=\\"img\\" aria-label=\\"loading\\" style=\\"font-size: 64px;\\" class=\\"anticon anticon-loading anticon-spin ant-spin-dot\\"><svg viewBox=\\"0 0 1024 1024\\" focusable=\\"false\\" data-icon=\\"loading\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z\\"></path></svg></span></div></div></div>"`; | ||
exports[`ResponseCodes should render ResponseCodes component 1`] = `"<div><div><h3>Error Codes ( Filter applied: < 100 and > 400 )</h3></div><div class=\\"ant-collapse ant-collapse-icon-position-left\\" role=\\"tablist\\"><div class=\\"ant-collapse-item\\"><div class=\\"ant-collapse-header\\" role=\\"tab\\" tabindex=\\"0\\" aria-expanded=\\"false\\"><div><span role=\\"img\\" aria-label=\\"right\\" class=\\"anticon anticon-right ant-collapse-arrow\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"right\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\\"></path></svg></span></div><span>500 <span class=\\"ant-badge ant-badge-not-a-wrapper\\"><sup data-show=\\"true\\" class=\\"ant-scroll-number ant-badge-count\\" title=\\"5\\"><span class=\\"ant-scroll-number-only\\" style=\\"transition: none;\\"><span class=\\"ant-scroll-number-only-unit current\\">5</span></span></sup></span></span></div></div><div class=\\"ant-collapse-item\\"><div class=\\"ant-collapse-header\\" role=\\"tab\\" tabindex=\\"0\\" aria-expanded=\\"false\\"><div><span role=\\"img\\" aria-label=\\"right\\" class=\\"anticon anticon-right ant-collapse-arrow\\"><svg viewBox=\\"64 64 896 896\\" focusable=\\"false\\" data-icon=\\"right\\" width=\\"1em\\" height=\\"1em\\" fill=\\"currentColor\\" aria-hidden=\\"true\\"><path d=\\"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z\\"></path></svg></span></div><span>501 <span class=\\"ant-badge ant-badge-not-a-wrapper\\"><sup data-show=\\"true\\" class=\\"ant-scroll-number ant-badge-count\\" title=\\"3\\"><span class=\\"ant-scroll-number-only\\" style=\\"transition: none;\\"><span class=\\"ant-scroll-number-only-unit current\\">3</span></span></sup></span></span></div></div></div></div>"`; |
48 changes: 48 additions & 0 deletions
48
web/frontend/src/components/Run/RunningStatus/SummaryTable/RunSummaryTable.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { render } from "@testing-library/react"; | ||
import React from "react"; | ||
|
||
import RunSummaryTable from "./RunSummaryTable"; | ||
|
||
describe("RunSummaryTable", () => { | ||
const mockMetrics = [ | ||
{ | ||
label: "Label 1", | ||
latencyP50: 50, | ||
latencyP99: 60, | ||
totalCount: 100, | ||
successCount: 90, | ||
errorsCount: 10, | ||
errorRate: 10, | ||
rpm: 200, | ||
responses: [ | ||
{ responseCode: "200", messages: ["Success message 1"] }, | ||
{ responseCode: "400", messages: ["Error message 1"] } | ||
] | ||
} | ||
]; | ||
|
||
const mockTotals = { | ||
totalLatencyP50: 55, | ||
totalLatencyP99: 65, | ||
totalCount: 200, | ||
totalSuccessCount: 180, | ||
totalErrorsCount: 20, | ||
totalErrorsRate: 10, | ||
totalRpm: 400 | ||
}; | ||
|
||
test("should render RunSummaryTable component", () => { | ||
const rendered = render( | ||
<RunSummaryTable | ||
metrics={mockMetrics} | ||
isLoading={false} | ||
totals={mockTotals} | ||
setLabelToShowGraph={() => {}} | ||
setActiveTabKey={() => {}} | ||
/> | ||
); | ||
|
||
const component = rendered.container; | ||
expect(component.outerHTML).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.