Skip to content

Commit

Permalink
update tests to match desired behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzevzl committed Oct 3, 2023
1 parent 96af225 commit 4304055
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ describe(ProjectMetadataPieceExporter, () => {
.ThenAProjectExistErrorShouldBeThrown();
});

it('fails when project output summary is not found', async () => {
await fixtures.GivenProjectExist(ProjectSourcesEnum.marxanCloud);
it('saves file successfully even when project output summary was never created yet', async () => {
const marxanSource = ProjectSourcesEnum.marxanCloud;
const input = fixtures.GivenAProjectMetadataExportJob();
await fixtures.GivenProjectExist(marxanSource);
await fixtures.GivenProjectBlmRangeExist();
await fixtures
.WhenPieceExporterIsInvoked(input)
.ThenAnOtuputSummaryExistErrorShouldBeThrown();
.ThenProjectMetadataFileIsSaved(marxanSource);
});

it('fails when project blm range is not found', async () => {
Expand Down Expand Up @@ -187,11 +189,6 @@ const getFixtures = async () => {
ThenAProjectBlmExistErrorShouldBeThrown: async () => {
await expect(sut.run(input)).rejects.toThrow(/blm.*does not exist/gi);
},
ThenAnOtuputSummaryExistErrorShouldBeThrown: async () => {
await expect(sut.run(input)).rejects.toThrow(
/Output Summary.*does not exist/gi,
);
},
ThenProjectMetadataFileIsSaved: async (sources: ProjectSourcesEnum) => {
const result = await sut.run(input);
const file = await fileRepository.get(result.uris[0].uri);
Expand Down

0 comments on commit 4304055

Please sign in to comment.