File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
2727import { useSnackbar } from "notistack" ;
2828import { formatDateTime } from "../_helpers/format.helper" ;
2929import TestStatusChip from "../components/TestStatusChip" ;
30+ import { Baseline } from "../types/baseline" ;
3031
3132const useStyles = makeStyles ( {
3233 media : {
@@ -68,39 +69,39 @@ const TestVariationDetailsPage: React.FunctionComponent = () => {
6869 < Grid item >
6970 < TestVariationDetails testVariation = { testVariation } />
7071 </ Grid >
71- { testVariation . baselines . map ( ( baseline ) => (
72+ { testVariation . baselines . map ( ( baseline : Baseline ) => (
7273 < Grid item key = { baseline . id } >
7374 < Card >
7475 < CardActions >
7576 < Button
7677 color = "primary"
7778 disabled = { ! baseline . testRun }
7879 onClick = { ( ) => {
79- if ( baseline . testRun ) {
80+ const { testRun } = baseline ;
81+ if ( testRun ) {
8082 history . push ( {
8183 pathname : buildProjectPageUrl (
8284 testVariation . projectId
8385 ) ,
8486 ...buildTestRunLocation (
85- baseline . testRun . buildId ,
86- baseline . testRunId
87+ testRun . buildId ,
88+ testRun . id
8789 ) ,
8890 } ) ;
8991 selectBuild (
9092 buildDispatch ,
91- baseline . testRun . buildId
93+ testRun . buildId
9294 ) . then ( ( ) =>
93- selectTestRun (
94- testRunDispatch ,
95- baseline . testRun . id
96- )
95+ selectTestRun ( testRunDispatch , testRun . id )
9796 ) ;
9897 }
9998 } }
10099 >
101100 Test Run
102101 </ Button >
103- < TestStatusChip status = { baseline . testRun . status } />
102+ { baseline . testRun && (
103+ < TestStatusChip status = { baseline . testRun . status } />
104+ ) }
104105 { baseline . user && (
105106 < Typography >
106107 { `${ baseline . user . firstName } ${ baseline . user . lastName } <${ baseline . user . email } >` }
Original file line number Diff line number Diff line change @@ -4,10 +4,9 @@ import { User } from "./user";
44export interface Baseline {
55 id : string ;
66 baselineName : string ;
7- testRunId : string ;
87 testVariationId : string ;
98 createdAt : string ;
109 updatedAt : string ;
11- testRun : TestRun ;
12- user : User ;
10+ testRun ? : TestRun ;
11+ user ? : User ;
1312}
You can’t perform that action at this time.
0 commit comments