Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: resolved test failing

=8a98b2e192c6
diff --git a/backend/e2e-test/routes/v3/auth-idp-attacks.spec.ts b/backend/e2e-test/routes/v3/auth-idp-attacks.spec.ts
index 0b88dc471d..7da49d703a 100644
--- a/backend/e2e-test/routes/v3/auth-idp-attacks.spec.ts
+++ b/backend/e2e-test/routes/v3/auth-idp-attacks.spec.ts
@@ -128,11 +128,11 @@ describe("Auth IdP Attack Vector Tests", () => {
userAgent: "test-agent"
});
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
const db = getDb();
const [membership] = await db(TableName.Membership).where({
- actorUserId: result.user.id,
+ actorUserId: result.userId,
scopeOrgId: ORG_A_ID,
scope: AccessScope.Organization
});
diff --git a/backend/e2e-test/routes/v3/auth-idp.spec.ts b/backend/e2e-test/routes/v3/auth-idp.spec.ts
index a0ea12481a..be660385a5 100644
--- a/backend/e2e-test/routes/v3/auth-idp.spec.ts
+++ b/backend/e2e-test/routes/v3/auth-idp.spec.ts
@@ -53,12 +53,12 @@ describe("Auth IdP Service-Level Tests", () => {
userAgent: "test-agent"
});
- expect(result.user).toBeDefined();
- createdUserIds.push(result.user.id);
+ expect(result.userId).toBeDefined();
+ createdUserIds.push(result.userId);
const db = getDb();
const [membership] = await db(TableName.Membership).where({
- actorUserId: result.user.id,
+ actorUserId: result.userId,
scopeOrgId: TEST_ORG_ID,
scope: AccessScope.Organization
});
@@ -83,7 +83,7 @@ describe("Auth IdP Service-Level Tests", () => {
expect(result.result).toBe(ProviderAuthResult.SIGNUP_REQUIRED);
expect(result).toHaveProperty("signupToken");
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
});
test("Same externalId reuses existing user", async () => {
@@ -100,7 +100,7 @@ describe("Auth IdP Service-Level Tests", () => {
ip: "127.0.0.1",
userAgent: "test-agent"
});
- createdUserIds.push(result1.user.id);
+ createdUserIds.push(result1.userId);
const result2 = await getServices().saml.samlLogin({
externalId,
@@ -113,7 +113,7 @@ describe("Auth IdP Service-Level Tests", () => {
userAgent: "test-agent"
});
- expect(result2.user.id).toBe(result1.user.id);
+ expect(result2.userId).toBe(result1.userId);
});
test("Login without verified domain throws", async () => {
@@ -226,8 +226,8 @@ describe("Auth IdP Service-Level Tests", () => {
userAgent: "test-agent"
});
- expect(result.user).toBeDefined();
- createdUserIds.push(result.user.id);
+ expect(result.userId).toBeDefined();
+ createdUserIds.push(result.userId);
const db = getDb();
const alias = await db(TableName.UserAliases).where({ externalId, orgId: TEST_ORG_ID }).first();
@@ -249,7 +249,7 @@ describe("Auth IdP Service-Level Tests", () => {
});
expect(result.result).toBe(ProviderAuthResult.SIGNUP_REQUIRED);
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
});
test("Same externalId reuses existing user", async () => {
@@ -265,7 +265,7 @@ describe("Auth IdP Service-Level Tests", () => {
ip: "127.0.0.1",
userAgent: "test-agent"
});
- createdUserIds.push(result1.user.id);
+ createdUserIds.push(result1.userId);
const result2 = await getServices().oidc.oidcLogin({
externalId,
@@ -277,7 +277,7 @@ describe("Auth IdP Service-Level Tests", () => {
userAgent: "test-agent"
});
- expect(result2.user.id).toBe(result1.user.id);
+ expect(result2.userId).toBe(result1.userId);
});
test("Login without verified domain throws", async () => {
diff --git a/backend/e2e-test/routes/v3/auth-signup-sso.spec.ts b/backend/e2e-test/routes/v3/auth-signup-sso.spec.ts
index 8b9635d3da..884979e868 100644
--- a/backend/e2e-test/routes/v3/auth-signup-sso.spec.ts
+++ b/backend/e2e-test/routes/v3/auth-signup-sso.spec.ts
@@ -55,12 +55,12 @@ describe("Auth SSO Signup V3", () => {
expect(result.result).toBe(ProviderAuthResult.SIGNUP_REQUIRED);
expect(result.signupToken).toBeDefined();
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
// Verify the signup token is a valid SIGNUP_TOKEN JWT
const decoded = decode(result.signupToken) as Record<string, unknown>;
expect(decoded.authTokenType).toBe(AuthTokenType.SIGNUP_TOKEN);
- expect(decoded.userId).toBe(result.user.id);
+ expect(decoded.userId).toBe(result.userId);
});
test("Email verification code is sent for new SSO user", async () => {
@@ -99,7 +99,7 @@ describe("Auth SSO Signup V3", () => {
});
expect(result.result).toBe(ProviderAuthResult.SIGNUP_REQUIRED);
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
// Extract verification code from email
const emails = smtp().getEmails();
@@ -127,7 +127,7 @@ describe("Auth SSO Signup V3", () => {
// Verify user is now accepted
const db = getDb();
- const user = await db(TableName.Users).where({ id: result.user.id }).first();
+ const user = await db(TableName.Users).where({ id: result.userId }).first();
expect(user?.isAccepted).toBe(true);
expect(user?.isEmailVerified).toBe(true);
});
@@ -146,7 +146,7 @@ describe("Auth SSO Signup V3", () => {
userAgent: "test-agent"
});
- createdUserIds.push(result.user.id);
+ createdUserIds.push(result.userId);
const res = await testServer.inject({
method: "POST",