Skip to content

Commit c185820

Browse files
Merge pull request #1220 from RedisInsight/fe/feature/RI-3373_Component_tests_44_45
#RI-3373 - Component tests 44 and 45 sprints. Groups for tests.
2 parents 0de8cff + 0e31dc9 commit c185820

File tree

286 files changed

+4722
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+4722
-18
lines changed

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { TextDecoder, TextEncoder } = require('util');
33
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
44
module.exports = {
55
testURL: 'http://localhost/',
6+
runner: 'groups',
67
moduleNameMapper: {
78
'\\.(jpg|jpeg|png|ico|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
89
'<rootDir>/redisinsight/__mocks__/fileMock.js',
@@ -44,6 +45,12 @@ module.exports = {
4445
'<rootDir>/redisinsight/ui/src/packages',
4546
'<rootDir>/redisinsight/ui/src/mocks',
4647
],
48+
coverageDirectory: './coverage',
49+
coveragePathIgnorePatterns: [
50+
'/node_modules/',
51+
'<rootDir>/redisinsight/api',
52+
'<rootDir>/redisinsight/ui/src/packages',
53+
],
4754
coverageThreshold: {
4855
global: {
4956
statements: 70,

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
"start:web:public": "cross-env PUBLIC_DEV=true webpack serve --config ./configs/webpack.config.web.dev.babel.js",
3939
"test": "jest ./redisinsight/ui -w 1",
4040
"test:watch": "jest ./redisinsight/ui --watch -w 1",
41-
"test:cov": "jest ./redisinsight/ui --coverage -w 1",
41+
"test:cov": "jest ./redisinsight/ui --group=unit --group=component --coverage -w 1",
42+
"test:cov:unit": "jest ./redisinsight/ui/src/slices/tests --group=unit --coverage -w 1",
43+
"test:cov:component": "jest ./redisinsight/ui --group=component --coverage -w 1",
4244
"type-check:ui": "tsc --project redisinsight/ui --noEmit"
4345
},
4446
"lint-staged": {
@@ -173,6 +175,7 @@
173175
"ioredis-mock": "^5.5.4",
174176
"ip": "^1.1.8",
175177
"jest": "^27.5.1",
178+
"jest-runner-groups": "^2.2.0",
176179
"jest-when": "^3.2.1",
177180
"lint-staged": "^10.2.11",
178181
"mini-css-extract-plugin": "^1.3.1",

redisinsight/ui/src/App.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { render } from 'uiSrc/utils/test-utils'
33

44
import App from './App'
55

6+
/**
7+
* App tests
8+
*
9+
* @group unit
10+
*/
611
describe('App', () => {
712
it('should render', () => {
813
expect(render(<App />)).toBeTruthy()

redisinsight/ui/src/Router.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { render } from 'uiSrc/utils/test-utils'
33

44
import Router from './Router'
55

6+
/**
7+
* Router tests
8+
*
9+
* @group unit
10+
*/
611
describe('Router', () => {
712
it('should render', () => {
813
expect(

redisinsight/ui/src/components/action-bar/ActionBar.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import ActionBar, { Props } from './ActionBar'
55

66
const mockedProps = mock<Props>()
77

8+
/**
9+
* ActionBar tests
10+
*
11+
* @group unit
12+
*/
813
describe('ActionBar', () => {
914
it('should render', () => {
1015
expect(render(<ActionBar {...instance(mockedProps)} />)).toBeTruthy()

redisinsight/ui/src/components/analytics-tabs/AnalyticsTabs.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jest.mock('react-router-dom', () => ({
1111
}),
1212
}))
1313

14+
/**
15+
* StreamTabs tests
16+
*
17+
* @group unit
18+
*/
1419
describe('StreamTabs', () => {
1520
it('should render', () => {
1621
expect(render(<AnalyticsTabs />)).toBeTruthy()

redisinsight/ui/src/components/bottom-group-components/BottomGroupComponents.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ beforeEach(() => {
2525
const commandHelperId = 'command-helper'
2626
const cliId = 'cli'
2727

28+
/**
29+
* BottomGroupComponents tests
30+
*
31+
* @group unit
32+
*/
2833
describe('BottomGroupComponents', () => {
2934
it('should render', () => {
3035
expect(

redisinsight/ui/src/components/bottom-group-components/components/bottom-group-minimized/BottomGroupMinimized.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ beforeEach(() => {
1212
store.clearActions()
1313
})
1414

15+
/**
16+
* BottomGroupMinimized tests
17+
*
18+
* @group unit
19+
*/
1520
describe('BottomGroupMinimized', () => {
1621
it('should render', () => {
1722
expect(

redisinsight/ui/src/components/bulk-actions-config/BulkActionsConfig.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ const deletingMock = [{
5050
}
5151
}]
5252

53+
/**
54+
* BulkActionsConfig tests
55+
*
56+
* @group unit
57+
*/
5358
describe('BulkActionsConfig', () => {
5459
it('should render', () => {
5560
expect(render(<BulkActionsConfig />)).toBeTruthy()

redisinsight/ui/src/components/charts/donut-chart/DonutChart.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const mockData: ChartData[] = [
1212
{ value: 15, name: 'F', color: [50, 50, 50] },
1313
]
1414

15+
/**
16+
* DonutChart tests
17+
*
18+
* @group unit
19+
*/
1520
describe('DonutChart', () => {
1621
it('should render with empty data', () => {
1722
expect(render(<DonutChart data={[]} />)).toBeTruthy()

0 commit comments

Comments
 (0)