Skip to content

Commit 370b69f

Browse files
#RI-5009 - fix tests
1 parent 165588e commit 370b69f

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

redisinsight/ui/src/pages/home/components/database-alias/DatabaseAlias.spec.tsx

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,13 @@ describe('DatabaseAlias', () => {
2222
expect(render(<DatabaseAlias {...mockedProps} />)).toBeTruthy()
2323
})
2424

25-
it('should call onApplyChanges on edit alias', () => {
26-
const onApply = jest.fn()
27-
render(<DatabaseAlias {...mockedProps} onApplyChanges={onApply} />)
28-
29-
fireEvent.click(screen.getByTestId('edit-alias-btn'))
30-
fireEvent.change(screen.getByTestId('alias-input'), { target: { value: 'alias' } })
31-
fireEvent.submit(screen.getByTestId('alias-input'))
32-
33-
expect(onApply).toHaveBeenCalledWith('alias', expect.anything(), expect.anything())
34-
})
35-
36-
it('should call onOpen', () => {
37-
const onOpen = jest.fn()
38-
render(<DatabaseAlias {...mockedProps} onOpen={onOpen} />)
39-
40-
fireEvent.click(screen.getByTestId('connect-to-db-btn'))
41-
expect(onOpen).toHaveBeenCalled()
42-
})
43-
4425
it('should not render part of content in edit mode', () => {
4526
render(<DatabaseAlias {...mockedProps} isCloneMode={false} alias="alias" />)
4627

4728
expect(screen.queryByTestId('back-btn')).not.toBeInTheDocument()
4829
expect(screen.queryByTestId('db-alias')).toHaveTextContent('alias')
4930
})
5031

51-
it('should call onCloneBack in clone mode', () => {
52-
const onCloneBack = jest.fn()
53-
render(<DatabaseAlias {...mockedProps} onCloneBack={onCloneBack} isCloneMode />)
54-
55-
fireEvent.click(screen.getByTestId('back-btn'))
56-
expect(onCloneBack).toHaveBeenCalled()
57-
})
58-
5932
it('should render icon for redis-stack', () => {
6033
render(<DatabaseAlias {...mockedProps} isRediStack />)
6134

redisinsight/ui/src/pages/home/components/databases-list-component/DatabasesListWrapper.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { RootState, store } from 'uiSrc/slices/store'
1111
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1212
import { errorHandlers } from 'uiSrc/mocks/res/responseComposition'
1313
import DatabasesListWrapper, { Props } from './DatabasesListWrapper'
14-
import DatabasesList, { Props as DatabasesListProps } from './databases-list'
14+
import DatabasesList, { Props as DatabasesListProps } from './databases-list/DatabasesList'
1515

1616
const mockedProps = mock<Props>()
1717

18-
jest.mock('./databases-list/databases-list', () => ({
18+
jest.mock('./databases-list/DatabasesList', () => ({
1919
__esModule: true,
2020
namedExport: jest.fn(),
2121
default: jest.fn(),

0 commit comments

Comments
 (0)