File tree Expand file tree Collapse file tree
x-pack/plugins/observability/public/components/app/section/ux Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,4 +76,27 @@ describe('UXSection', () => {
7676 expect ( queryAllByText ( 'View in app' ) ) . toEqual ( [ ] ) ;
7777 expect ( getByText ( 'elastic-co-frontend' ) ) . toBeInTheDocument ( ) ;
7878 } ) ;
79+ it ( 'shows empty state' , ( ) => {
80+ jest . spyOn ( fetcherHook , 'useFetcher' ) . mockReturnValue ( {
81+ data : undefined ,
82+ status : fetcherHook . FETCH_STATUS . SUCCESS ,
83+ refetch : jest . fn ( ) ,
84+ } ) ;
85+ const { getByText, queryAllByText, getAllByText } = render (
86+ < UXSection
87+ absoluteTime = { {
88+ start : moment ( '2020-06-29T11:38:23.747Z' ) . valueOf ( ) ,
89+ end : moment ( '2020-06-29T12:08:23.748Z' ) . valueOf ( ) ,
90+ } }
91+ relativeTime = { { start : 'now-15m' , end : 'now' } }
92+ bucketSize = "60s"
93+ serviceName = "elastic-co-frontend"
94+ />
95+ ) ;
96+
97+ expect ( getByText ( 'User Experience' ) ) . toBeInTheDocument ( ) ;
98+ expect ( getAllByText ( 'No data is available.' ) ) . toHaveLength ( 3 ) ;
99+ expect ( queryAllByText ( 'View in app' ) ) . toEqual ( [ ] ) ;
100+ expect ( getByText ( 'elastic-co-frontend' ) ) . toBeInTheDocument ( ) ;
101+ } ) ;
79102} ) ;
You can’t perform that action at this time.
0 commit comments