Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Enterprise-CMCS/macpro-mako into mo…
Browse files Browse the repository at this point in the history
…ck-test-s3
  • Loading branch information
thetif committed Jan 8, 2025
2 parents 2e23b55 + ea3e350 commit a988c6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/lambda/processEmails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("process emails Handler", () => {
Body: { Text: { Data: "This is a mocked email body.", Charset: "UTF-8" } },
},
};
await expect(sendEmail(params, "test")).rejects.toThrowError();
await expect(sendEmail(params, "bad-test")).rejects.toThrowError();
});
it("should validate the email template and throw an error", async () => {
const template = {
Expand Down
7 changes: 3 additions & 4 deletions lib/libs/email/getAllStateUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type StateUser = {
formattedEmailAddress: string;
};

const cognitoClient = new CognitoIdentityProviderClient({
region: process.env.region,
});

export const getAllStateUsers = async ({
userPoolId,
state,
Expand All @@ -29,6 +25,9 @@ export const getAllStateUsers = async ({
Limit: 60,
};
const command = new ListUsersCommand(params);
const cognitoClient = new CognitoIdentityProviderClient({
region: process.env.region,
});
const response: ListUsersCommandOutput = await cognitoClient.send(command);

if (!response.Users || response.Users.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion mocks/handlers/aws/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const emailHandlers = [
http.post<PathParams>("https://sqs.us-east-1.amazonaws.com/", async () => {
return new HttpResponse(null, { status: 200 });
}),
http.post<PathParams>("https://email.us-east-1.amazonaws.com/", async () => {
http.post<PathParams>(`https://email.us-east-1.amazonaws.com/`, async () => {
return HttpResponse.xml(`
<SendEmailResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
<SendEmailResult>
Expand Down

0 comments on commit a988c6b

Please sign in to comment.