Skip to content

Commit a79e9a6

Browse files
author
ALENA NABOKA
committed
Merge branch 'main' into e2e/feature/RI-2904-enablement-area
2 parents 8e6bf5c + f3fa47f commit a79e9a6

File tree

73 files changed

+1204
-105
lines changed

Some content is hidden

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

73 files changed

+1204
-105
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"test": "jest ./redisinsight/ui -w 1",
4040
"test:watch": "jest ./redisinsight/ui --watch -w 1",
4141
"test:cov": "jest ./redisinsight/ui --coverage -w 1",
42+
"test:cov:unit": "jest ./redisinsight/ui --group=-component --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/.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,20 @@ module.exports = {
7979
'index',
8080
],
8181
pathGroups: [
82+
{
83+
pattern: 'apiSrc/**',
84+
group: 'internal',
85+
position: 'after'
86+
},
8287
{
8388
pattern: '{.,..}/*.scss', // same directory only
8489
// pattern: '{.,..}/**/*\.scss' // same & outside directories (e.g. import '../foo/foo.scss')
8590
group: 'object',
8691
position: 'after'
8792
}
8893
],
89-
warnOnUnassignedImports: true
94+
warnOnUnassignedImports: true,
95+
pathGroupsExcludedImportTypes: ['builtin']
9096
},
9197
],
9298
},

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect } from 'react'
22
import cx from 'classnames'
3-
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'
3+
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiHideFor, EuiShowFor } from '@elastic/eui'
44
import { useDispatch, useSelector } from 'react-redux'
55
import { useParams } from 'react-router-dom'
66
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
@@ -135,7 +135,12 @@ const BottomGroupMinimized = () => {
135135
>
136136
<>
137137
<EuiIcon type={SurveyIcon} className={styles.surveyIcon} />
138-
<span>We need your opinion. Please take our survey.</span>
138+
<EuiHideFor sizes={['xs', 's']}>
139+
<span>We need your opinion. Please take our survey.</span>
140+
</EuiHideFor>
141+
<EuiShowFor sizes={['xs', 's']}>
142+
<span>Survey</span>
143+
</EuiShowFor>
139144
</>
140145
</a>
141146
</div>

redisinsight/ui/src/components/inline-item-editor/InlineItemEditor.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { validateScoreNumber } from 'uiSrc/utils'
55
import InlineItemEditor, { Props } from './InlineItemEditor'
66

77
const mockedProps = mock<Props>()
8-
const INLINE_ITEM_EDITOR = 'inline-item-editor'
8+
export const INLINE_ITEM_EDITOR = 'inline-item-editor'
99

1010
describe('InlineItemEditor', () => {
1111
it('should render', () => {

redisinsight/ui/src/components/inline-item-editor/InlineItemEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const InlineItemEditor = (props: Props) => {
164164
display="inlineBlock"
165165
title={isDisabled && disabledTooltipText?.title}
166166
content={isDisabled && disabledTooltipText?.text}
167+
data-testid="apply-tooltip"
167168
>
168169
<EuiButtonIcon
169170
iconSize={iconSize ?? 'l'}

redisinsight/ui/src/components/query-card/QueryCardCliPlugin/QueryCardCliPlugin.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useContext, useEffect, useRef, useState } from 'react'
22
import { useDispatch, useSelector } from 'react-redux'
33
import cx from 'classnames'
4+
import { v4 as uuidv4 } from 'uuid'
45
import { EuiFlexItem, EuiIcon, EuiLoadingContent, EuiTextColor } from '@elastic/eui'
56
import { pluginApi } from 'uiSrc/services/PluginAPI'
67
import { ThemeContext } from 'uiSrc/contexts/themeContext'
@@ -210,7 +211,7 @@ const QueryCardCliPlugin = (props: Props) => {
210211
useEffect(() => {
211212
const view = visualizations.find((visualization: IPluginVisualization) => visualization.uniqId === id)
212213
if (view) {
213-
generatedIframeNameRef.current = `${view.plugin.name}-${Date.now()}`
214+
generatedIframeNameRef.current = `${view.plugin.name}-${uuidv4()}`
214215
setCurrentView(view)
215216

216217
const { plugin } = view

redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ const QueryCardHeader = (props: Props) => {
245245
className={styles.tooltip}
246246
content="Raw Mode"
247247
position="bottom"
248+
data-testid="raw-mode-tooltip"
248249
>
249-
<EuiTextColor className={cx(styles.timeText, styles.mode)}>
250+
<EuiTextColor className={cx(styles.timeText, styles.mode)} data-testid="raw-mode-anchor">
250251
-r
251252
</EuiTextColor>
252253
</EuiToolTip>

redisinsight/ui/src/components/query-card/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@import '@elastic/eui/src/global_styling/index';
44

55
.containerWrapper {
6+
min-width: 420px;
67
&:nth-of-type(even) {
78
background-color: var(--euiColorEmptyShade) !important;
89
}

redisinsight/ui/src/pages/analytics/AnalyticsPage.spec.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ beforeEach(() => {
1515
store.clearActions()
1616
})
1717

18+
/**
19+
* AnalyticsPage tests
20+
*
21+
* @group component
22+
*/
1823
describe('AnalyticsPage', () => {
1924
it('should render', () => {
2025
expect(

0 commit comments

Comments
 (0)