mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
more mock
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import nock from "nock";
|
||||
|
||||
export const mockThirdPartyApiCalls = () => {
|
||||
const CLOUDFLARE_ACCOUNT_ID = "A2A6347F-88B5-442D-9798-95E408BC7701";
|
||||
|
||||
// We mock the Cloudflare account API calls to let adding app connection much easier in BDD tests.
|
||||
// It's mainly for the DNS provider validation in ACME challenge validation.
|
||||
const mockCloudflare = () => {
|
||||
nock("https://api.cloudflare.com:443")
|
||||
.get("/client/v4/accounts/MOCK_ACCOUNT_ID")
|
||||
.reply(200, {
|
||||
result: {
|
||||
id: "A2A6347F-88B5-442D-9798-95E408BC7701",
|
||||
id: CLOUDFLARE_ACCOUNT_ID,
|
||||
name: "Mock Account",
|
||||
type: "standard",
|
||||
settings: {
|
||||
@@ -53,7 +57,7 @@ export const mockThirdPartyApiCalls = () => {
|
||||
},
|
||||
owner: { id: null, type: "user", email: null },
|
||||
account: {
|
||||
id: "A2A6347F-88B5-442D-9798-95E408BC7701",
|
||||
id: CLOUDFLARE_ACCOUNT_ID,
|
||||
name: "Mock Account"
|
||||
},
|
||||
tenant: { id: null, name: null },
|
||||
@@ -85,3 +89,7 @@ export const mockThirdPartyApiCalls = () => {
|
||||
messages: []
|
||||
});
|
||||
};
|
||||
|
||||
export const mockThirdPartyApiCalls = () => {
|
||||
mockCloudflare();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user