File tree Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -128,14 +128,8 @@ describe('StatisticsPage', () => {
128
128
it ( 'renders the empty state when pipeline data is empty' , ( ) => {
129
129
( rdiPipelineStatusSelector as jest . Mock ) . mockReturnValueOnce ( {
130
130
data : {
131
- components : { processor : 'not-ready' } ,
132
- pipelines : {
133
- default : {
134
- status : 'not-ready' ,
135
- state : 'some' ,
136
- tasks : 'none' ,
137
- }
138
- }
131
+ components : { } ,
132
+ pipelines : { }
139
133
}
140
134
} )
141
135
const { getByText } = render ( < StatisticsPage /> )
Original file line number Diff line number Diff line change 1
- import { get } from 'lodash'
1
+ import { isEmpty } from 'lodash'
2
2
import React , { useEffect } from 'react'
3
3
import { useDispatch , useSelector } from 'react-redux'
4
4
import { useParams } from 'react-router-dom'
@@ -11,7 +11,7 @@ import RdiInstancePageTemplate from 'uiSrc/templates/rdi-instance-page-template'
11
11
import { formatLongName , Nullable , setTitle } from 'uiSrc/utils'
12
12
import { setLastPageContext } from 'uiSrc/slices/app/context'
13
13
import { PageNames } from 'uiSrc/constants'
14
- import { IPipelineStatus , PipelineStatus } from 'uiSrc/slices/interfaces'
14
+ import { IPipelineStatus } from 'uiSrc/slices/interfaces'
15
15
import Clients from './clients'
16
16
import DataStreams from './data-streams'
17
17
import Empty from './empty'
@@ -26,7 +26,7 @@ const isPipelineDeployed = (data: Nullable<IPipelineStatus>) => {
26
26
return false
27
27
}
28
28
29
- return get ( data , 'pipelines.default.status' ) !== PipelineStatus . NotReady
29
+ return ! isEmpty ( data . pipelines )
30
30
}
31
31
32
32
const StatisticsPage = ( ) => {
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ export enum PipelineStatus {
138
138
export interface IPipelineStatus {
139
139
components : Record < string , unknown >
140
140
pipelines : {
141
- defaults : {
141
+ defaults ? : {
142
142
status : PipelineStatus
143
143
state : unknown
144
144
tasks : unknown
You can’t perform that action at this time.
0 commit comments