Skip to content

Commit

Permalink
Add another CMS project to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
biwano committed Jan 5, 2024
1 parent 4a7a29b commit 71502b2
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion carbonmark-api/test/routes/projects/get.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { FastifyInstance } from "fastify";
import { cloneDeep, pick, set } from "lodash";
import nock from "nock";
import {
Project as CmsProject,
Maybe,
ProjectContent,
Slug,
} from "../../../src/.generated/types/cms.types";
import {
CarbonProject,
Registry,
Expand Down Expand Up @@ -41,6 +47,16 @@ const anotherMarketplaceProject: MarketplaceProject = {
registry: "VCS",
vintage: "2000",
};
const anotherCmsProject: CmsProject = {
...cloneDeep(mockCmsProject),
registryProjectId: "111",
id: "VCS-111" as unknown as Maybe<Slug>,
};

const anotherCmsProjectContent: ProjectContent = cloneDeep(
mockCmsProjectContent
);
(anotherCmsProjectContent.project as any).registryProjectId = "111";

const credit = fixtures.digitalCarbon.digitalCarbonProject.carbonCredits[0];
const expectedPrices = [
Expand Down Expand Up @@ -74,7 +90,10 @@ describe("GET /projects", () => {
mockMarketplaceArgs();
mockDigitalCarbonArgs();
mockTokens();
mockCms();
mockCms({
projects: [mockCmsProject, anotherCmsProject],
content: [mockCmsProjectContent, anotherCmsProjectContent],
});
});

// /** The happy path */
Expand Down

0 comments on commit 71502b2

Please sign in to comment.