Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

test: test pipeline for unit test is configured (#1277)

Palashb8c3fd1cbf61
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index f9096698cc..8f346bf882 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -17,6 +17,8 @@ jobs:
run: cd frontend && yarn install
- name: Run ESLint
run: cd frontend && npm run lint
+ - name: Run Jest
+ run: cd frontend && npm run jest
- name: TSC
run: yarn tsc
working-directory: ./frontend
diff --git a/frontend/jest.setup.ts b/frontend/jest.setup.ts
index 6557f780cf..b3b8061422 100644
--- a/frontend/jest.setup.ts
+++ b/frontend/jest.setup.ts
@@ -2,3 +2,4 @@
* Adds custom matchers from the react testing library to all tests
*/
import '@testing-library/jest-dom';
+import 'jest-styled-components';
diff --git a/frontend/package.json b/frontend/package.json
index ebaffb5fae..f93bc9684c 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -159,6 +159,7 @@
"husky": "^7.0.4",
"is-ci": "^3.0.1",
"jest-playwright-preset": "^1.7.0",
+ "jest-styled-components": "^7.0.8",
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "^12.3.7",
"portfinder-sync": "^0.0.2",
diff --git a/frontend/src/components/NotFound/__snapshots__/NotFound.test.tsx.snap b/frontend/src/components/NotFound/__snapshots__/NotFound.test.tsx.snap
index 0e9ce92e30..9da91a31bd 100644
--- a/frontend/src/components/NotFound/__snapshots__/NotFound.test.tsx.snap
+++ b/frontend/src/components/NotFound/__snapshots__/NotFound.test.tsx.snap
@@ -2,8 +2,102 @@
exports[`Not Found page test should render Not Found page without errors 1`] = `
<DocumentFragment>
- <div
- class="sc-gsDKAQ cLXpIa"
+ .c3 {
+ border: 2px solid #2f80ed;
+ box-sizing: border-box;
+ border-radius: 10px;
+ width: 400px;
+ background: inherit;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 24px;
+ line-height: 20px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ padding-top: 14px;
+ padding-bottom: 14px;
+ color: #2f80ed;
+}
+
+.c0 {
+ min-height: 80vh;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c2 {
+ font-style: normal;
+ font-weight: 300;
+ font-size: 18px;
+ line-height: 20px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+ text-align: center;
+ color: #828282;
+ text-align: center;
+ margin: 0;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ -webkit-box-align: center;
+ -ms-flex-align: center;
+ align-items: center;
+}
+
+.c1 {
+ min-height: 50px;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: justify;
+ -webkit-justify-content: space-between;
+ -ms-flex-pack: justify;
+ justify-content: space-between;
+ -webkit-flex-direction: column;
+ -ms-flex-direction: column;
+ flex-direction: column;
+ margin-bottom: 30px;
+ margin-top: 20px;
+}
+
+<div
+ class="c0"
>
<svg
fill="none"
@@ -272,21 +366,21 @@ exports[`Not Found page test should render Not Found page without errors 1`] = `
</defs>
</svg>
<div
- class="sc-hKwDye foaleg"
+ class="c1"
>
<p
- class="sc-dkPtRN fcyVIq"
+ class="c2"
>
Ah, seems like we reached a dead end!
</p>
<p
- class="sc-dkPtRN fcyVIq"
+ class="c2"
>
Page Not Found
</p>
</div>
<a
- class="sc-bdvvtL dbTZkj"
+ class="c3"
href="/application"
tabindex="0"
>
diff --git a/frontend/src/container/TraceFlameGraph/__tests__/__snapshots__/TraceFlameGraph.test.tsx.snap b/frontend/src/container/TraceFlameGraph/__tests__/__snapshots__/TraceFlameGraph.test.tsx.snap
index 39a3638956..c8c24ebfd4 100644
--- a/frontend/src/container/TraceFlameGraph/__tests__/__snapshots__/TraceFlameGraph.test.tsx.snap
+++ b/frontend/src/container/TraceFlameGraph/__tests__/__snapshots__/TraceFlameGraph.test.tsx.snap
@@ -2,12 +2,30 @@
exports[`loads and displays greeting 1`] = `
<DocumentFragment>
- <div
- class="sc-gsDKAQ jFDWPs"
+ .c1 {
+ position: absolute;
+ top: 0px;
+ left: NaN%;
+ width: Infinity%;
+ height: 10px;
+ margin: 1px 0;
+ background-color: hsl(282.9,100%,60.7%);
+ border-radius: 5px;
+ z-index: 1;
+}
+
+.c0 {
+ position: relative;
+ width: 100%;
+ height: 120px;
+}
+
+<div
+ class="c0"
height="0"
>
<div
- class="sc-bdvvtL fyFVjh"
+ class="c1"
title=""
width="Infinity"
/>
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index b3aa27fe50..a10bce6e81 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -35,6 +35,7 @@
"playwright.config.ts",
"./commitlint.config.js",
"./webpack.config.js",
- "./webpack.config.prod.js"
+ "./webpack.config.prod.js",
+ "./jest.setup.ts"
]
}
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index 2227658f6b..3a254370a1 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -8128,6 +8128,13 @@ jest-snapshot@^27.5.1:
pretty-format "^27.5.1"
semver "^7.3.2"
+jest-styled-components@^7.0.8:
+ version "7.0.8"
+ resolved "https://registry.yarnpkg.com/jest-styled-components/-/jest-styled-components-7.0.8.tgz#9ea3b43f002de060b4638fde3b422d14b3e3ec9f"
+ integrity sha512-0KE54d0yIzKcvtOv8eikyjG3rFRtKYUyQovaoha3nondtZzXYGB3bhsvYgEegU08Iry0ndWx2+g9f5ZzD4I+0Q==
+ dependencies:
+ css "^3.0.0"
+
jest-util@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1"