Skip to content

Commit

Permalink
chore: remove unecessary mockConsentRequestObject util
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Nov 20, 2023
1 parent a8dbf3e commit 8381a07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/gConsent/manage/getAccessGrant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { mockAccessApiEndpoint } from "../request/request.mock";
import {
mockAccessGrantObject,
mockAccessGrantVc,
mockConsentRequestObject,
mockAccessRequestVc,
} from "../util/access.mock";
import { toBeEqual } from "../util/toBeEqual.mock";
import { getAccessGrant } from "./getAccessGrant";
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("getAccessGrant", () => {
it("throws if the given IRI does not resolve to a access grant Verifiable Credential", async () => {
mockAccessApiEndpoint();
const mockedFetch = jest.fn(global.fetch).mockResolvedValueOnce(
new Response(JSON.stringify(mockConsentRequestObject()), {
new Response(JSON.stringify(await mockAccessRequestVc()), {
headers: new Headers([["content-type", "application/json"]]),
}),
);
Expand Down
8 changes: 0 additions & 8 deletions src/gConsent/util/access.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ export const mockAccessGrantVc = async (
return accessGrant as unknown as AccessGrant;
};

export const mockConsentRequestObject = (options?: RequestVcOptions) => {
const requestVc = mockAccessRequestVcObject(options);
requestVc.credentialSubject.hasConsent.forPurpose = ["https://some.purpose"];
requestVc.expirationDate = new Date(2021, 8, 14).toISOString();
requestVc.issuanceDate = new Date(2021, 8, 13).toISOString();
return requestVc;
};

export const mockConsentRequestVc = async (
options?: RequestVcOptions,
framingOptions?: {
Expand Down

0 comments on commit 8381a07

Please sign in to comment.