Skip to content

Commit

Permalink
test: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Jan 18, 2024
1 parent b07b584 commit 7bd8886
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions packages/manager/test/__testutils__/mockSliceMachineAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ type MockSliceMachineAPIConfig = {
expectedCookies: string[];
environments: Environment[];
};
gitGitHubCreateAuthStateV1Endpoint?: {
isSuccessful?: boolean;
expectedAuthenticationToken: string;
key: string;
expiresAt: Date;
};
};

export const mockSliceMachineAPI = (
Expand Down Expand Up @@ -56,36 +50,4 @@ export const mockSliceMachineAPI = (
),
);
}

if (config.gitGitHubCreateAuthStateV1Endpoint) {
ctx.msw.use(
rest.get(
new URL(`./git/github/create-auth-state`, endpoint).toString(),
(req, res, ctx) => {
if (
config.gitGitHubCreateAuthStateV1Endpoint &&
(config.gitGitHubCreateAuthStateV1Endpoint.isSuccessful ?? true)
) {
if (
req.headers.get("Authorization") ===
`Bearer ${config.gitGitHubCreateAuthStateV1Endpoint.expectedAuthenticationToken}`
) {
return res(
ctx.json({
key: config.gitGitHubCreateAuthStateV1Endpoint.key,
expiresAt:
config.gitGitHubCreateAuthStateV1Endpoint.expiresAt,
}),
ctx.status(200),
);
} else {
return res(ctx.status(418));
}
} else {
return res(ctx.status(418));
}
},
),
);
}
};

0 comments on commit 7bd8886

Please sign in to comment.