Skip to content

Commit eafe31b

Browse files
committed
#RI-2932 - removed useless interfaces and mocked Data.now
1 parent e9f81c9 commit eafe31b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

redisinsight/ui/src/slices/browser/stream.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export function deleteStreamEntry(key: string, entries: string[], onSuccessActio
481481
// Asynchronous thunk action
482482
export function fetchConsumerGroups(
483483
resetData?: boolean,
484-
onSuccess?: (data: GetStreamEntriesResponse) => void,
484+
onSuccess?: () => void,
485485
onFailed?: () => void,
486486
) {
487487
return async (dispatch: AppDispatch, stateInit: () => RootState) => {
@@ -501,7 +501,7 @@ export function fetchConsumerGroups(
501501

502502
if (isStatusSuccessful(status)) {
503503
dispatch(loadConsumerGroupsSuccess(data))
504-
onSuccess?.(data)
504+
onSuccess?.()
505505
}
506506
} catch (_err) {
507507
if (!axios.isCancel(_err)) {
@@ -518,7 +518,7 @@ export function fetchConsumerGroups(
518518
// Asynchronous thunk action
519519
export function fetchConsumers(
520520
resetData?: boolean,
521-
onSuccess?: (data: GetStreamEntriesResponse) => void,
521+
onSuccess?: () => void,
522522
onFailed?: () => void,
523523
) {
524524
return async (dispatch: AppDispatch, stateInit: () => RootState) => {
@@ -556,7 +556,7 @@ export function fetchConsumers(
556556
// Asynchronous thunk action
557557
export function fetchConsumerMessages(
558558
resetData?: boolean,
559-
onSuccess?: (data: PendingEntryDto[]) => void,
559+
onSuccess?: () => void,
560560
onFailed?: () => void,
561561
) {
562562
return async (dispatch: AppDispatch, stateInit: () => RootState) => {
@@ -577,7 +577,7 @@ export function fetchConsumerMessages(
577577
)
578578
if (isStatusSuccessful(status)) {
579579
dispatch(loadConsumerMessagesSuccess(data))
580-
onSuccess?.(data)
580+
onSuccess?.()
581581
}
582582
} catch (_err) {
583583
if (!axios.isCancel(_err)) {

redisinsight/ui/src/slices/tests/browser/stream.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ const mockMessages: PendingEntryDto[] = [{
111111
delivered: 1321,
112112
}]
113113

114+
Date.now = jest.fn(() => Date.parse('2021-05-27'))
115+
114116
beforeEach(() => {
115117
cleanup()
116118
store = cloneDeep(mockedStore)
@@ -507,6 +509,9 @@ describe('stream slice', () => {
507509
describe('loadConsumerGroupsSuccess', () => {
508510
it('should properly set groups.data = payload', () => {
509511
// Arrange
512+
513+
console.log('Date.now()', Date.now())
514+
510515
const data: ConsumerGroupDto[] = [{
511516
name: '123',
512517
consumers: 123,

0 commit comments

Comments
 (0)