Add tests for errors when fetching actions

This commit is contained in:
Josh Gross
2023-01-24 13:29:23 -05:00
parent 416e32e29b
commit 54261296bb
@@ -110,4 +110,23 @@ describe("action descriptions", () => {
expect(await getDescription("typo", mock)).toBeUndefined();
});
// TODO: https://github.com/github/c2c-actions-experience/issues/7056
it.failing("action does not exist", async () => {
const mock = fetchMock
.sandbox()
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yml?ref=v3", 404)
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yaml?ref=v3", 404);
expect(await getDescription("repository", mock)).toBeUndefined();
});
// TODO: https://github.com/github/c2c-actions-experience/issues/7056
it.failing("invalid permissions", async () => {
const mock = fetchMock
.sandbox()
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yml?ref=v3", 403);
expect(await getDescription("repository", mock)).toBeUndefined();
});
});