Don't say analyses failed when the workflow was canceled
This commit is contained in:
@@ -108,4 +108,5 @@ export const Stopped = Template.bind({});
|
||||
Stopped.args = {
|
||||
...Started.args,
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Canceled,
|
||||
completedRepositoryCount: 10,
|
||||
};
|
||||
|
||||
@@ -24,12 +24,21 @@ function getIcon(
|
||||
skippedRepositoryCount: number,
|
||||
) {
|
||||
if (successfulRepositoryCount < completedRepositoryCount) {
|
||||
return (
|
||||
<>
|
||||
<HorizontalSpace size={2} />
|
||||
<ErrorIcon label="Some analyses failed" />
|
||||
</>
|
||||
);
|
||||
if (variantAnalysisStatus === VariantAnalysisStatus.Canceled) {
|
||||
return (
|
||||
<>
|
||||
<HorizontalSpace size={2} />
|
||||
<ErrorIcon label="Some analyses were stopped" />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<HorizontalSpace size={2} />
|
||||
<ErrorIcon label="Some analyses failed" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
} else if (skippedRepositoryCount > 0) {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -108,6 +108,20 @@ describe(VariantAnalysisStats.name, () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders an error icon when the overall variant analysis status is canceled and some analyses failed", () => {
|
||||
render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Canceled,
|
||||
completedRepositoryCount: 10,
|
||||
successfulRepositoryCount: 5,
|
||||
});
|
||||
|
||||
expect(
|
||||
screen.getByRole("img", {
|
||||
name: "Some analyses were stopped",
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders an error icon when some analyses failed but also some repositories were skipped", () => {
|
||||
render({
|
||||
completedRepositoryCount: 10,
|
||||
|
||||
Reference in New Issue
Block a user