-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: API changes for handling new submission_email
location
#3582
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
de31006
init api changes
RODO94 718e011
lint fix api files
RODO94 0dbd0a8
alter getTeamEmailSettings to pull from new column
RODO94 72fb6fd
fix api tests
RODO94 de2d5e8
tidy sendEmail ts change
RODO94 3ed6729
update query mocks
RODO94 477ec97
lint fixing
RODO94 f5d3f49
lint fix e2e
RODO94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,10 @@ describe(`sending an application by email to a planning office`, () => { | |
data: { | ||
teams: [ | ||
{ | ||
sendToEmail: "[email protected]", | ||
settings: { emailReplyToId: "abc123" }, | ||
notifyPersonalisation: { | ||
emailReplyToId: "abc123", | ||
sendToEmail: "[email protected]", | ||
}, | ||
}, | ||
], | ||
}, | ||
|
@@ -145,15 +147,17 @@ describe(`sending an application by email to a planning office`, () => { | |
}); | ||
}); | ||
|
||
it("errors if this team does not have a 'submission_email' configured in teams", async () => { | ||
it("errors if this team does not have a 'submission_email' configured in team settings", async () => { | ||
queryMock.mockQuery({ | ||
name: "GetTeamEmailSettings", | ||
matchOnVariables: false, | ||
data: { | ||
teams: [ | ||
{ | ||
sendToEmail: null, | ||
settings: { emailReplyToId: "abc123" }, | ||
notifyPersonalisation: { | ||
emailReplyToId: "abc123", | ||
sendToEmail: null, | ||
}, | ||
}, | ||
], | ||
}, | ||
|
@@ -200,7 +204,13 @@ describe(`downloading application data received by email`, () => { | |
name: "GetTeamEmailSettings", | ||
matchOnVariables: false, | ||
data: { | ||
teams: [{ sendToEmail: "[email protected]" }], | ||
teams: [ | ||
{ | ||
notifyPersonalisation: { | ||
sendToEmail: "[email protected]", | ||
}, | ||
}, | ||
], | ||
}, | ||
variables: { slug: "southwark" }, | ||
}); | ||
|
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 |
---|---|---|
|
@@ -41,8 +41,8 @@ export const contextDefaults: Context = { | |
}, | ||
settings: { | ||
homepage: "planx.uk", | ||
submissionEmail: "[email protected]", | ||
}, | ||
submissionEmail: "[email protected]", | ||
}, | ||
}; | ||
|
||
|
@@ -58,9 +58,9 @@ export async function setUpTestContext( | |
context.team.id = await $admin.team.create({ | ||
slug: context.team.slug, | ||
name: context.team.name, | ||
submissionEmail: context.team.submissionEmail, | ||
settings: { | ||
homepage: context.team.settings?.homepage, | ||
submissionEmail: context.team.submissionEmail, | ||
}, | ||
}); | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: If we're only using the
sendToEmail
field in this file, and not the rest of thenotifyPersonalisation
object, it would be cleaner / neater to destructure one level deeper here, and then not have to repeatedly writenotifyPersonalisation.sendToEmail
throughout the file 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are also using
...notifyPersonalisation
for part of the code below. I'll keep as is now.