Skip to content

Commit

Permalink
chore(4793): fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
junminahn committed Feb 3, 2025
1 parent 2f353b7 commit 349f019
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ runs:
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install Root NPM packages
run: pnpm install
run: pnpm install --frozen-lockfile
shell: bash

- name: Install App NPM packages
run: pnpm install
run: pnpm install --frozen-lockfile
shell: bash
working-directory: app
2 changes: 1 addition & 1 deletion .github/workflows/localdev-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/actions/setup-tools

- name: Install Dependencies
run: pnpm install
run: pnpm install --frozen-lockfile
working-directory: localdev/m365mock

- name: Build the Application
Expand Down
60 changes: 30 additions & 30 deletions app/app/api/public-cloud/emails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ describe('Public Cloud Emails', () => {
expect(sendEmail).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
body: expect.compareEmailText(
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
),
}),
);
expect(sendEmail).toHaveBeenNthCalledWith(
3,
expect.objectContaining({
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
body: expect.compareEmailText(
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
),
}),
);
Expand Down Expand Up @@ -89,24 +89,24 @@ describe('Public Cloud Emails', () => {
expect(sendEmail).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
body: expect.compareEmailText(
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
),
}),
);
expect(sendEmail).toHaveBeenNthCalledWith(
3,
expect.objectContaining({
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
body: expect.compareEmailText(
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
),
}),
);
Expand Down Expand Up @@ -151,24 +151,24 @@ describe('Public Cloud Emails', () => {
expect(sendEmail).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
body: expect.compareEmailText(
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
),
}),
);
expect(sendEmail).toHaveBeenNthCalledWith(
3,
expect.objectContaining({
subject: `You have been added as the Expense Authority for ${decisionData.name}`,
to: expect.arrayContaining([decisionData.expenseAuthority.email]),
subject: 'Your provisioning request has been approved',
to: expect.arrayContaining([
decisionData.projectOwner.email,
decisionData.primaryTechnicalLead.email,
decisionData.secondaryTechnicalLead?.email,
]),
body: expect.compareEmailText(
`You are now the Expense Authority for the the product ${decisionData.name} on the Public Cloud.`,
`We are pleased to inform you that your request to create the product ${decisionData.name} has been approved on the Public Cloud Landing Zone ${decisionData.provider}.`,
),
}),
);
Expand Down
3 changes: 2 additions & 1 deletion app/utils/js/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export function compareEmailText(html: string, targets: string | string[]) {
target = normalizeText(target);
if (!converted.includes(target)) {
pass = false;
message = `expected ${target} in ${converted}`;
message = `expected <<${target}>> in <<${converted}>>`;
console.log(message);
return false;
}
});
Expand Down
2 changes: 1 addition & 1 deletion data-migrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ["package.json", "pnpm-lock.yaml", "migrate-mongo-config.js", "./"]
COPY migrations migrations

RUN npm install -g turbo pnpm
RUN pnpm install --ignore-scripts
RUN pnpm install --frozen-lockfile --ignore-scripts

USER node

Expand Down
2 changes: 1 addition & 1 deletion localdev/ches-mock/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /opt
COPY ches-mock ./context

RUN npm install -g turbo pnpm
RUN cd context && pnpm install --ignore-scripts && pnpm build
RUN cd context && pnpm install --frozen-lockfile --ignore-scripts && pnpm build

FROM node:22.12.0-alpine3.19
WORKDIR /opt
Expand Down
4 changes: 2 additions & 2 deletions localdev/keycloak-provision/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ COPY keycloak-provision ./context
COPY _packages ./_packages

RUN npm install -g turbo pnpm
RUN cd context && pnpm install --ignore-scripts
RUN cd _packages/keycloak-admin && pnpm install --ignore-scripts && pnpm build
RUN cd context && pnpm install --frozen-lockfile --ignore-scripts
RUN cd _packages/keycloak-admin && pnpm install --frozen-lockfile --ignore-scripts && pnpm build
RUN cd context && pnpm build

FROM node:22.12.0-alpine3.19
Expand Down
2 changes: 1 addition & 1 deletion localdev/m365mock/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY ["mock-users.json", "types.ts", "./"]
COPY m365mock ./context

RUN npm install -g turbo pnpm
RUN cd context && pnpm install --ignore-scripts && pnpm build
RUN cd context && pnpm install --frozen-lockfile --ignore-scripts && pnpm build

FROM node:22.12.0-alpine3.19
WORKDIR /opt
Expand Down
4 changes: 2 additions & 2 deletions localdev/nats-provision/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ COPY nats-provision ./context
COPY _packages ./_packages

RUN npm install -g turbo pnpm
RUN cd context && pnpm install --ignore-scripts
RUN cd _packages/keycloak-admin && pnpm install --ignore-scripts && pnpm build
RUN cd context && pnpm install --frozen-lockfile --ignore-scripts
RUN cd _packages/keycloak-admin && pnpm install --frozen-lockfile --ignore-scripts && pnpm build
RUN cd context && pnpm build

FROM node:22.12.0-alpine3.19
Expand Down

0 comments on commit 349f019

Please sign in to comment.