@@ -13,19 +13,21 @@ import userEvent from '@testing-library/user-event';
1313import { render , renderHook , renderHookAct } from '../../../test/rtl' ;
1414
1515import {
16- TimeWindowButtons ,
17- useTimeWindow ,
16+ EuiTimeWindowButtons ,
17+ useEuiTimeWindow ,
1818 ZOOM_FACTOR_DEFAULT ,
1919} from './time_window_buttons' ;
2020
21- describe ( 'TimeWindowButtons: useTimeWindow hook' , ( ) => {
21+ describe ( 'EuiTimeWindowButtons: useEuiTimeWindow hook' , ( ) => {
2222 describe ( 'displayInterval' , ( ) => {
2323 it ( 'handles relative times' , ( ) => {
2424 const applyTime = jest . fn ( ) ;
2525 const start = 'now-15m' ;
2626 const end = 'now' ;
2727
28- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
28+ const { result } = renderHook ( ( ) =>
29+ useEuiTimeWindow ( start , end , applyTime )
30+ ) ;
2931
3032 expect ( result . current . displayInterval ) . toBe ( '15 minutes' ) ;
3133 } ) ;
@@ -35,7 +37,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
3537 const start = '2025-10-29T16:00:00.000Z' ;
3638 const end = '2025-10-29T16:15:00.000Z' ;
3739
38- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
40+ const { result } = renderHook ( ( ) =>
41+ useEuiTimeWindow ( start , end , applyTime )
42+ ) ;
3943
4044 expect ( result . current . displayInterval ) . toBe ( '15 minutes' ) ;
4145 } ) ;
@@ -45,8 +49,10 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
4549 const start = undefined ;
4650 const end = '2025-10-29T16:15:00.000Z' ;
4751
48- // @ts -expect-error - intentionally testing with undefined start value
49- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
52+ const { result } = renderHook ( ( ) =>
53+ // @ts -expect-error - intentionally testing with undefined start value
54+ useEuiTimeWindow ( start , end , applyTime )
55+ ) ;
5056
5157 expect ( result . current . displayInterval ) . toBe ( '' ) ;
5258 expect ( result . current . isInvalid ) . toBeTruthy ( ) ;
@@ -57,7 +63,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
5763 const start = '2025-10-29T16:00:00.000Z' ;
5864 const end = 'not a date' ;
5965
60- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
66+ const { result } = renderHook ( ( ) =>
67+ useEuiTimeWindow ( start , end , applyTime )
68+ ) ;
6169
6270 expect ( result . current . displayInterval ) . toBe ( '' ) ;
6371 expect ( result . current . isInvalid ) . toBeTruthy ( ) ;
@@ -68,7 +76,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
6876 const start = '2025-10-27T16:00:01.000Z' ;
6977 const end = '2025-10-29T16:12:00.000Z' ;
7078
71- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
79+ const { result } = renderHook ( ( ) =>
80+ useEuiTimeWindow ( start , end , applyTime )
81+ ) ;
7282
7383 expect ( result . current . displayInterval ) . toBe ( '~2 days' ) ;
7484 } ) ;
@@ -80,7 +90,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
8090 const start = '2025-10-30T10:00:00.000Z' ;
8191 const end = '2025-10-30T11:00:00.000Z' ;
8292
83- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
93+ const { result } = renderHook ( ( ) =>
94+ useEuiTimeWindow ( start , end , applyTime )
95+ ) ;
8496
8597 renderHookAct ( ( ) => {
8698 result . current . stepForward ( ) ;
@@ -99,7 +111,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
99111 const start = '2025-10-30T10:00:00.000Z' ;
100112 const end = '2025-10-30T11:00:00.000Z' ;
101113
102- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
114+ const { result } = renderHook ( ( ) =>
115+ useEuiTimeWindow ( start , end , applyTime )
116+ ) ;
103117
104118 renderHookAct ( ( ) => {
105119 result . current . stepBackward ( ) ;
@@ -124,7 +138,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
124138 ) ;
125139 const shiftedEnd = moment ( end ) . add ( ZOOM_FACTOR_DEFAULT / 2 , 'hours' ) ;
126140
127- const { result } = renderHook ( ( ) => useTimeWindow ( start , end , applyTime ) ) ;
141+ const { result } = renderHook ( ( ) =>
142+ useEuiTimeWindow ( start , end , applyTime )
143+ ) ;
128144
129145 renderHookAct ( ( ) => {
130146 result . current . expandWindow ( ) ;
@@ -149,7 +165,9 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
149165 const shiftedEnd = moment ( end ) . add ( customZoomFactor / 2 , 'hours' ) ;
150166
151167 const { result } = renderHook ( ( ) =>
152- useTimeWindow ( start , end , applyTime , { zoomFactor : customZoomFactor } )
168+ useEuiTimeWindow ( start , end , applyTime , {
169+ zoomFactor : customZoomFactor ,
170+ } )
153171 ) ;
154172
155173 renderHookAct ( ( ) => {
@@ -164,13 +182,13 @@ describe('TimeWindowButtons: useTimeWindow hook', () => {
164182 } ) ;
165183} ) ;
166184
167- describe ( 'TimeWindowButtons ' , ( ) => {
185+ describe ( 'EuiTimeWindowButtons ' , ( ) => {
168186 it ( 'renders' , ( ) => {
169187 const start = 'now-15m' ;
170188 const end = 'now' ;
171189
172190 const { container } = render (
173- < TimeWindowButtons start = { start } end = { end } applyTime = { ( ) => { } } />
191+ < EuiTimeWindowButtons start = { start } end = { end } applyTime = { ( ) => { } } />
174192 ) ;
175193
176194 expect ( container . firstChild ) . toMatchSnapshot ( ) ;
@@ -184,7 +202,7 @@ describe('TimeWindowButtons', () => {
184202 const end = 'now' ;
185203
186204 const { getByTestSubject, findByText } = render (
187- < TimeWindowButtons start = { start } end = { end } applyTime = { apply } />
205+ < EuiTimeWindowButtons start = { start } end = { end } applyTime = { apply } />
188206 ) ;
189207
190208 act ( ( ) => {
0 commit comments