-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use
$api
client for requests from Hasura → API (#2297)
* feat: Create client for 'api' role * chore: Replace with * fix: Tidy up * feat: Drop `publicGraphQLClient` in favour of `$public` client (#2300)
- Loading branch information
1 parent
419a1bc
commit 4c65722
Showing
23 changed files
with
81 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,15 @@ import { | |
mockSoftDeleteLowcalSession, | ||
mockValidateSingleSessionRequest, | ||
} from "../tests/mocks/saveAndReturnMocks"; | ||
import { CoreDomainClient } from "@opensystemslab/planx-core"; | ||
|
||
// https://docs.notifications.service.gov.uk/node.html#email-addresses | ||
const TEST_EMAIL = "[email protected]"; | ||
const SAVE_ENDPOINT = "/send-email/save"; | ||
|
||
jest.mock("@opensystemslab/planx-core", () => { | ||
return { | ||
CoreDomainClient: jest.fn().mockImplementation(() => ({ | ||
formatRawProjectTypes: jest | ||
.fn() | ||
.mockResolvedValue(["New office premises"]), | ||
})), | ||
}; | ||
}); | ||
jest | ||
.spyOn(CoreDomainClient.prototype, "formatRawProjectTypes") | ||
.mockResolvedValue("New office premises"); | ||
|
||
describe("Send Email endpoint", () => { | ||
beforeEach(() => { | ||
|
@@ -93,7 +88,7 @@ describe("Send Email endpoint", () => { | |
name: "ValidateSingleSessionRequest", | ||
data: { | ||
flows_by_pk: mockFlow, | ||
lowcal_sessions: [], | ||
lowcalSessions: [], | ||
}, | ||
}); | ||
|
||
|
@@ -258,7 +253,7 @@ describe("Setting up send email events", () => { | |
name: "ValidateSingleSessionRequest", | ||
data: { | ||
flows_by_pk: mockFlow, | ||
lowcal_sessions: [{ ...mockLowcalSession, has_user_saved: true }], | ||
lowcalSessions: [{ ...mockLowcalSession, has_user_saved: true }], | ||
}, | ||
matchOnVariables: false, | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.