Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"vite/esbuild": "^0.25.0",
"react-router-dom/react-router/path-to-regexp": "^1.9.0",
"**/form-data": "^4.0.4",
"redux": "^5.0.1",
"@types/react": "18.2.1",
"@types/react-dom": "18.2.1"
},
Expand Down Expand Up @@ -146,7 +147,6 @@
"@types/pako": "^2.0.0",
"@types/react": "^18.0.20",
"@types/react-dom": "^18.0.5",
"@types/react-redux": "^7.1.12",
"@types/react-router-dom": "^5.3.3",
"@types/react-virtualized": "^9.21.10",
"@types/react-window-infinite-loader": "^1.0.6",
Expand Down Expand Up @@ -218,6 +218,7 @@
"prettier": "3.5.2",
"react-refresh": "^0.9.0",
"redux-mock-store": "^1.5.4",
"redux-thunk": "^3.1.0",
"regenerator-runtime": "^0.13.5",
"rimraf": "^3.0.2",
"sass": "npm:sass-embedded",
Expand Down Expand Up @@ -261,7 +262,7 @@
"@redis-ui/icons": "^6.9.3",
"@redis-ui/styles": "^15.0.0",
"@redis-ui/table": "^3.7.0",
"@reduxjs/toolkit": "^1.6.2",
"@reduxjs/toolkit": "^2.12.0",
"@stablelib/snappy": "^1.0.2",
"@types/json-dup-key-validator": "^1.0.2",
"ajv": "^8.18.0",
Expand Down Expand Up @@ -308,7 +309,7 @@
"react-hotkeys-hook": "^3.3.1",
"react-jsx-parser": "^2.4.1",
"react-monaco-editor": "^0.59.0",
"react-redux": "^7.2.2",
"react-redux": "^9.2.0",
"react-resizable-panels": "^3.0.2",
"react-rnd": "^10.3.5",
"react-router-dom": "^5.3.4",
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/desktop/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"apiClient/*": ["redisinsight/api-client/*"]
}
},
"include": ["**/*"],
"include": ["**/*", "../ui/src/types/redux-augment.d.ts"],
"exclude": ["dll/*", "dist", "node_modules"]
}
3 changes: 0 additions & 3 deletions redisinsight/ui/.tscheck.rec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,6 @@
"src/utils/streamUtils.ts": {
"TS2345": 2
},
"src/utils/test-utils.tsx": {
"TS2322": 2
},
"src/utils/tests/apiResponse.spec.ts": {
"TS2345": 1,
"TS2739": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('CliBodyWrapper', () => {
beforeEach(() => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('OAuthJobs', () => {
beforeEach(() => {
const state = store.getState() as RootState

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,9 @@ react@^17.0.2:
loose-envify "^1.1.0"
object-assign "^4.1.1"

"redisinsight-plugin-sdk@file:../redisinsight-plugin-sdk":
version "1.1.0"

redux@^4.0.0, redux@^4.0.4:
version "4.2.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.1.tgz#c08f4306826c49b5e9dc901dee0452ea8fce6197"
Expand Down Expand Up @@ -1851,7 +1854,7 @@ vfile@^4.0.0, vfile@^4.2.0:
vfile-message "^2.0.0"

"vite@file:../node_modules/vite":
version "6.3.4"
version "6.4.1"
dependencies:
esbuild "^0.25.0"
fdir "^6.4.4"
Expand Down
6 changes: 4 additions & 2 deletions redisinsight/ui/src/pages/browser/BrowserPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ beforeEach(() => {
})

const selectKey = (state: any, selectedKey: any, data?: any = {}) => {
;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down Expand Up @@ -125,7 +125,9 @@ describe('BrowserPage', () => {
}

beforeAll(() => {
;(useSelector as jest.Mock).mockImplementation(originalUseSelector)
;(useSelector as unknown as jest.Mock).mockImplementation(
originalUseSelector,
)
})

it.each([true, false])(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jest.mock('react-redux', () => ({
beforeEach(() => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('BulkActions', () => {
it('bulk actions summary should render with any search', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('BulkActions', () => {
it('bulk actions summary should render with any filter', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('BulkActions', () => {
describe('Telemetry', () => {
it('should call proper telemetry events', async () => {
const state: any = store.getState()
;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jest.mock('react-redux', () => ({
beforeEach(() => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jest.mock('react-redux', () => ({
beforeEach(() => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand All @@ -54,7 +54,7 @@ describe('BulkDeleteSummary', () => {
it('summary should contain calculated text', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('BulkDeleteSummary', () => {
it('should show folder key count when keyCount is set (folder delete)', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('BulkDeleteSummary', () => {
it('should show approximate title for folder delete when scan not complete', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('BulkDeleteSummary', () => {
it('should show N/A when scanned is 0 (avoid division by zero)', () => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('RediSearchIndexesList', () => {
beforeEach(() => {
const state: any = store.getState()

;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: any) => any) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.mock('react-redux', () => ({
useSelector: jest.fn(),
}))

const mockUseSelector = useSelector as jest.Mock
const mockUseSelector = useSelector as unknown as jest.Mock

describe('useKeyFormat hook', () => {
const renderUseKeyFormat = () => renderHook(() => useKeyFormat())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,10 @@ describe('Node', () => {
instances: { connectedInstance: { id: mockInstanceId } },
},
}
let currentState = { ...initialState, ...connectionState }
const customStore = {
getState: () => ({ ...initialState, ...connectionState }),
subscribe: jest.fn(),
getState: () => currentState,
subscribe: jest.fn(() => () => {}),
dispatch: jest.fn(),
}

Expand All @@ -501,10 +502,7 @@ describe('Node', () => {
{ store: customStore },
)

customStore.getState = () => ({
...updatedState,
...connectionState,
})
currentState = { ...updatedState, ...connectionState }

rerender(
<MakeSearchableModalProvider>
Expand Down Expand Up @@ -532,20 +530,21 @@ describe('Node', () => {
onDeleteClicked: jest.fn(),
}

const customStore = {
getState: () => ({
app: {
context: {
dbConfig: {
shownColumns: columns,
},
const customState = {
app: {
context: {
dbConfig: {
shownColumns: columns,
},
},
connections: {
instances: { connectedInstance: { id: mockInstanceId } },
},
}),
subscribe: jest.fn(),
},
connections: {
instances: { connectedInstance: { id: mockInstanceId } },
},
}
const customStore = {
getState: () => customState,
subscribe: jest.fn(() => () => {}),
dispatch: jest.fn(),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jest.mock('uiSrc/slices/browser/rejson', () => ({
fetchReJSON: jest.fn((key) => ({ type: 'FETCH_REJSON', payload: key })),
}))

const mockedUseDispatch = reactRedux.useDispatch as jest.Mock
const mockedUseSelector = reactRedux.useSelector as jest.Mock
const mockedUseDispatch = reactRedux.useDispatch as unknown as jest.Mock
const mockedUseSelector = reactRedux.useSelector as unknown as jest.Mock
const mockKeyName = stringToBuffer('test-key')

describe('useChangeEditorType', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jest.mock('uiSrc/components/hooks/useDatabaseEnvironment', () => ({

const mockedProps = mock<Props>()

const mockUseSelector = useSelector as jest.Mock
const mockUseDispatch = useDispatch as jest.Mock
const mockUseSelector = useSelector as unknown as jest.Mock
const mockUseDispatch = useDispatch as unknown as jest.Mock

type Selector = {
name: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jest.mock('react-redux', () => ({
useSelector: jest.fn(),
}))

const mockUseSelector = useSelector as jest.Mock
const mockUseSelector = useSelector as unknown as jest.Mock

describe('AddItem', () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jest.mock('react-redux', () => ({
}))

const connectType = (state: any, connectionType: any) => {
;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jest.mock('uiSrc/slices/instances/instances', () => ({
updateInstanceAction: jest.fn().mockReturnValue({ type: 'UPDATE_INSTANCE' }),
}))

const mockDispatch = useDispatch as jest.MockedFunction<typeof useDispatch>
const mockDispatch = useDispatch as unknown as jest.MockedFunction<
typeof useDispatch
>
const mockInstance: Partial<Instance> = {
id: '1',
name: 'Test Instance',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ jest.mock('react-redux', () => ({
connect: () => (Component: any) => Component,
}))

const mockSelector = useSelector as jest.MockedFunction<typeof useSelector>
const mockSelector = useSelector as unknown as jest.MockedFunction<
typeof useSelector
>

describe('TagInputField', () => {
const mockOnChange = jest.fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jest.mock('react-redux', () => ({
connect: () => (Component: any) => Component,
}))

const mockSelector = useSelector as jest.MockedFunction<typeof useSelector>
const mockSelector = useSelector as unknown as jest.MockedFunction<
typeof useSelector
>

const mockTags: Tag[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const mockInitialState = (
instances: Instance[],
options?: { selectedTags?: Set<string> },
) => {
;(useSelector as jest.Mock).mockImplementation(
;(useSelector as unknown as jest.Mock).mockImplementation(
(callback: (arg0: RootState) => RootState) =>
callback({
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ jest.mock('react-redux', () => ({
connect: () => (Component: any) => Component,
}))

const mockDispatch = useDispatch as jest.MockedFunction<typeof useDispatch>
const mockSelector = useSelector as jest.MockedFunction<typeof useSelector>
const mockDispatch = useDispatch as unknown as jest.MockedFunction<
typeof useDispatch
>
const mockSelector = useSelector as unknown as jest.MockedFunction<
typeof useSelector
>

const mockTags: Tag[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ const mockTags: Tag[] = [
},
]

const mockDispatch = useDispatch as jest.MockedFunction<typeof useDispatch>
const mockSelector = useSelector as jest.MockedFunction<typeof useSelector>
const mockDispatch = useDispatch as unknown as jest.MockedFunction<
typeof useDispatch
>
const mockSelector = useSelector as unknown as jest.MockedFunction<
typeof useSelector
>

describe('useFilterTags', () => {
beforeEach(() => {
Expand Down
Loading
Loading