Skip to content

Commit 39d68cd

Browse files
committed
fix tests
1 parent 2c2eb03 commit 39d68cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/common/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export type GenericConfigType = {
5050
AuditLogTable: string;
5151
ApiKeyTable: string;
5252
ConfigSecretName: string;
53+
TestingCredentialsSecret: string;
5354
};
5455

5556
type EnvironmentConfigType = {
@@ -87,7 +88,8 @@ const genericConfig: GenericConfigType = {
8788
RoomRequestsStatusTableName: "infra-core-api-room-requests-status",
8889
AuditLogTable: "infra-core-api-audit-log",
8990
ApiKeyTable: "infra-core-api-keys",
90-
ConfigSecretName: "infra-core-api-config"
91+
ConfigSecretName: "infra-core-api-config",
92+
TestingCredentialsSecret: "infra-core-api-testing-credentials",
9193
} as const;
9294

9395
const environmentConfig: EnvironmentConfigType = {
@@ -100,7 +102,7 @@ const environmentConfig: EnvironmentConfigType = {
100102
/^https:\/\/(?:.*\.)?acmuiuc\.pages\.dev$/,
101103
/http:\/\/localhost:\d+$/,
102104
],
103-
ConfigurationSecretIds: ["infra-core-api-testing-credentials", genericConfig.ConfigSecretName],
105+
ConfigurationSecretIds: [genericConfig.TestingCredentialsSecret, genericConfig.ConfigSecretName],
104106
AadValidClientId: "39c28870-94e4-47ee-b4fb-affe0bf96c9f",
105107
LinkryBaseUrl: "https://core.aws.qa.acmuiuc.org",
106108
PasskitIdentifier: "pass.org.acmuiuc.qa.membership",

tests/unit/vitest.setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ smMock.on(GetSecretValueCommand).callsFake((command) => {
114114
if (command.SecretId == genericConfig.ConfigSecretName) {
115115
return Promise.resolve({ SecretString: secretJson });
116116
}
117-
if (command.SecretId == environmentConfig["dev"].TestingCredentialsSecret) {
117+
if (command.SecretId == genericConfig.TestingCredentialsSecret) {
118118
return Promise.resolve({ SecretString: testSecretJson });
119119
}
120-
return Promise.reject(new Error("Secret ID not mocked"));
120+
return Promise.reject(new Error(`Secret ID ${command.SecretID} not mocked`));
121121
});
122122

123123
vi.mock("ioredis", () => import("ioredis-mock"));

0 commit comments

Comments
 (0)