Skip to content

Commit

Permalink
Merge pull request #2313 from akhilmhdh/feat/test-import
Browse files Browse the repository at this point in the history
Feat/test import
  • Loading branch information
maidul98 authored Sep 3, 2024
2 parents 7cd092c + afb5820 commit ce7bb82
Show file tree
Hide file tree
Showing 24 changed files with 2,308 additions and 706 deletions.
35 changes: 35 additions & 0 deletions backend/e2e-test/routes/v1/secret-approval-policy.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { seedData1 } from "@app/db/seed-data";

const createPolicy = async (dto: { name: string; secretPath: string; approvers: string[]; approvals: number }) => {
const res = await testServer.inject({
method: "POST",
url: `/api/v1/secret-approvals`,
headers: {
authorization: `Bearer ${jwtAuthToken}`
},
body: {
workspaceId: seedData1.project.id,
environment: seedData1.environment.slug,
name: dto.name,
secretPath: dto.secretPath,
approvers: dto.approvers,
approvals: dto.approvals
}
});

expect(res.statusCode).toBe(200);
return res.json().approval;
};

describe("Secret approval policy router", async () => {
test("Create policy", async () => {
const policy = await createPolicy({
secretPath: "/",
approvals: 1,
approvers: [seedData1.id],
name: "test-policy"
});

expect(policy.name).toBe("test-policy");
});
});
Loading

0 comments on commit ce7bb82

Please sign in to comment.