File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
redisinsight/ui/src/pages/home/components/db-status Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,22 @@ jest.mock('uiSrc/telemetry', () => ({
1818
1919const mockedProps = mock < Props > ( )
2020const daysToMs = ( days : number ) => days * 60 * 60 * 24 * 1000
21+ let mockDate : Date
2122
2223describe ( 'DbStatus' , ( ) => {
24+ beforeEach ( ( ) => {
25+ jest . clearAllMocks ( )
26+
27+ // Set up fake timers
28+ jest . useFakeTimers ( )
29+ mockDate = new Date ( '2024-11-22T12:00:00Z' )
30+ jest . setSystemTime ( mockDate )
31+ } )
32+
33+ afterEach ( ( ) => {
34+ jest . useRealTimers ( )
35+ } )
36+
2337 it ( 'should render' , ( ) => {
2438 expect ( render ( < DbStatus { ...mockedProps } /> ) ) . toBeTruthy ( )
2539 } )
@@ -108,7 +122,7 @@ describe('DbStatus', () => {
108122
109123 await waitForRiTooltipVisible ( 1_000 )
110124
111- expect ( sendEventTelemetry ) . toBeCalledWith ( {
125+ expect ( sendEventTelemetry ) . toHaveBeenCalledWith ( {
112126 event : TelemetryEvent . CLOUD_NOT_USED_DB_NOTIFICATION_VIEWED ,
113127 eventData : {
114128 capability : expect . any ( String ) ,
Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ const DbStatus = (props: Props) => {
8888 )
8989
9090 if ( isFree && daysDiff >= LAST_CONNECTION_L ) {
91- return renderWarningTooltip ( CHECK_CLOUD_DATABASE , 'checkIfDeleted' )
91+ return renderWarningTooltip (
92+ CHECK_CLOUD_DATABASE ,
93+ WarningTypes . CheckIfDeleted ,
94+ )
9295 }
9396
9497 if ( isFree && daysDiff >= LAST_CONNECTION_SM ) {
You can’t perform that action at this time.
0 commit comments