diff --git a/test/helpers/BuildMapper.test.tsx b/test/helpers/BuildMapper.test.tsx index 83bddcda..edebe594 100644 --- a/test/helpers/BuildMapper.test.tsx +++ b/test/helpers/BuildMapper.test.tsx @@ -32,6 +32,16 @@ describe("buildDatetimeStatus", () => { expect(buildDatetimeStatus(build, 2)).toMatch(/Failed$/); }); + it("should return canceled build", () => { + const build = generateBuild("CANCELED"); + expect(buildDatetimeStatus(build, 2)).toMatch(/Canceled$/); + }); + + it("should append canceled to an active build", () => { + const build = generateBuild("CANCELED"); + expect(buildDatetimeStatus(build, build.id)).toMatch(/Active - Canceled$/); + }); + it("should use the scheduled_on date if the ended_on prop is null", () => { const datetimeStatus = buildDatetimeStatus( { @@ -43,4 +53,9 @@ describe("buildDatetimeStatus", () => { ); expect(datetimeStatus).toContain("November 8th, 2022"); }); + + it("should add tack on additional status if current build has any status other than completed", () => { + const build = generateBuild("FAILED"); + expect(buildDatetimeStatus(build, build.id)).toMatch(/Active - Failed$/); + }); });