Skip to content

Commit 98adc2c

Browse files
authored
Add the username to the baseline history who has approved the new ben… (#214)
* Add the username to the baseline history who has approved the new benchmark Visual-Regression-Tracker/Visual-Regression-Tracker#143 * Update test.data.helper.ts
1 parent 9a68e72 commit 98adc2c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/_test/test.data.helper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const TEST_VARIATION_ONE: TestVariation = {
6666
createdAt: "2020-09-14T06:57:25.845Z",
6767
updatedAt: "2020-09-14T06:57:25.845Z",
6868
testRun: testRunMock,
69+
user: TEST_USER,
6970
},
7071
{
7172
id: "some baseline id2",
@@ -75,6 +76,7 @@ export const TEST_VARIATION_ONE: TestVariation = {
7576
createdAt: "2020-09-12T06:57:25.845Z",
7677
updatedAt: "2020-09-12T06:57:25.845Z",
7778
testRun: testRunMock,
79+
user: TEST_USER,
7880
},
7981
],
8082
};
@@ -101,6 +103,7 @@ export const TEST_VARIATION_TWO: TestVariation = {
101103
createdAt: "2020-09-14T06:57:25.845Z",
102104
updatedAt: "2020-09-14T06:57:25.845Z",
103105
testRun: testRunMock,
106+
user: TEST_USER,
104107
},
105108
{
106109
id: "some baseline id2",
@@ -110,6 +113,7 @@ export const TEST_VARIATION_TWO: TestVariation = {
110113
createdAt: "2020-09-12T06:57:25.845Z",
111114
updatedAt: "2020-09-12T06:57:25.845Z",
112115
testRun: testRunMock,
116+
user: TEST_USER,
113117
},
114118
],
115119
};
@@ -118,6 +122,7 @@ export const TEST_BUILD_FAILED: Build = {
118122
id: "someId",
119123
number: 1,
120124
ciBuildId: "some build id",
125+
projectId: TEST_PROJECT.id,
121126
projectName: "Project name",
122127
branchName: "Branch name",
123128
status: BuildStatus.failed,
@@ -135,6 +140,7 @@ export const TEST_BUILD_PASSED: Build = {
135140
id: "someId2",
136141
number: 2,
137142
ciBuildId: "",
143+
projectId: TEST_PROJECT.id,
138144
projectName: "Project name",
139145
branchName: "Branch name",
140146
status: BuildStatus.passed,
@@ -152,6 +158,7 @@ export const TEST_BUILD_UNRESOLVED: Build = {
152158
id: "someId3",
153159
number: 3,
154160
ciBuildId: "",
161+
projectId: TEST_PROJECT.id,
155162
projectName: "Project name",
156163
branchName: "Branch name",
157164
status: BuildStatus.unresolved,

src/pages/TestVariationDetailsPage.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
makeStyles,
1212
CardActions,
1313
Button,
14+
Typography,
1415
} from "@material-ui/core";
1516
import {
1617
buildProjectPageUrl,
@@ -25,6 +26,7 @@ import {
2526
} from "../contexts";
2627
import { useSnackbar } from "notistack";
2728
import { formatDateTime } from "../_helpers/format.helper";
29+
import TestStatusChip from "../components/TestStatusChip";
2830

2931
const useStyles = makeStyles({
3032
media: {
@@ -96,8 +98,17 @@ const TestVariationDetailsPage: React.FunctionComponent = () => {
9698
}
9799
}}
98100
>
99-
{formatDateTime(baseline.createdAt)}
101+
Test Run
100102
</Button>
103+
<TestStatusChip status={baseline.testRun.status} />
104+
{baseline.user && (
105+
<Typography>
106+
{`${baseline.user.firstName} ${baseline.user.lastName} <${baseline.user.email}>`}
107+
</Typography>
108+
)}
109+
<Typography>
110+
{formatDateTime(baseline.createdAt)}
111+
</Typography>
101112
</CardActions>
102113
<CardMedia
103114
component="img"

src/types/baseline.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { TestRun } from "./testRun";
2+
import { User } from "./user";
23

34
export interface Baseline {
45
id: string;
@@ -8,4 +9,5 @@ export interface Baseline {
89
createdAt: string;
910
updatedAt: string;
1011
testRun: TestRun;
12+
user: User;
1113
}

src/types/testStatus.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export enum TestStatus {
44
unresolved = "unresolved",
55
failed = "failed",
66
approved = "approved",
7+
autoApproved = "autoApproved",
78
}

0 commit comments

Comments
 (0)