Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+5
-23
@@ -6,10 +6,6 @@ import {
|
||||
TEST_API_CONFIG,
|
||||
TEST_JWT_SECRET,
|
||||
configureApiIsolationDependenciesForTests,
|
||||
createLegacyEntityFixture,
|
||||
createLegacyRelationshipRowFixture,
|
||||
createLegacyRowFixture,
|
||||
createLegacyRowRelationshipFixture,
|
||||
createStoredApiKeyFixture,
|
||||
installApiIsolationTestHooks,
|
||||
patchApiIsolationConfig,
|
||||
@@ -19,27 +15,14 @@ import {
|
||||
installApiIsolationTestHooks();
|
||||
|
||||
describe("api-key isolation fixtures", () => {
|
||||
test("exposes stable default runtime and row fixtures", () => {
|
||||
test("exposes stable default runtime and api-key fixtures", () => {
|
||||
const apiKey = createStoredApiKeyFixture();
|
||||
const entity = createLegacyEntityFixture();
|
||||
const row = createLegacyRowFixture();
|
||||
const relationshipRow = createLegacyRelationshipRowFixture();
|
||||
const rowRelationship = createLegacyRowRelationshipFixture();
|
||||
|
||||
expect(TEST_API_CONFIG.apiAccessToken).toBe("service-secret");
|
||||
expect(TEST_API_CONFIG.jwtSecret).toBe(TEST_JWT_SECRET);
|
||||
expect(TEST_JWT_SECRET).toBe("scope-secret");
|
||||
expect(getApiRuntimeConfig()).toMatchObject({ apiAccessToken: "service-secret", jwtSecret: "scope-secret" });
|
||||
expect(apiKey).toMatchObject({ tenantId: "tenant_1", tenant: { id: "tenant_1" }, active: true, entities: [] });
|
||||
expect(entity).toMatchObject({ id: "entity_1", name: "contact" });
|
||||
expect(row).toMatchObject({ id: "row_1", entityId: "entity_1", tenantId: "tenant_1", parentRows: [], childRows: [] });
|
||||
expect(relationshipRow).toEqual({ id: "row_1", entityId: "entity_1", tenantId: "tenant_1" });
|
||||
expect(rowRelationship).toMatchObject({
|
||||
id: "row_relationship_1",
|
||||
parentId: "parent_row_1",
|
||||
childId: "child_row_1",
|
||||
relationship: { parentId: "parent_entity_1", childId: "child_entity_1" },
|
||||
});
|
||||
expect(apiKey).toMatchObject({ tenantId: "tenant_1", tenant: { id: "tenant_1" }, active: true });
|
||||
});
|
||||
|
||||
test("patches tenant-related fixture values without hiding mismatches", () => {
|
||||
@@ -47,12 +30,13 @@ describe("api-key isolation fixtures", () => {
|
||||
|
||||
const apiKey = createStoredApiKeyFixture({ tenantId: "tenant_2" });
|
||||
const mismatchedApiKey = createStoredApiKeyFixture({ tenantId: "tenant_2", tenant: { id: "tenant_3", name: "Other", slug: "other", deactivatedReason: null } });
|
||||
const row = createLegacyRowFixture("row_tenant_2", { tenantId: "tenant_2" });
|
||||
// tenant provided without an explicit tenantId → tenantId is derived from tenant.id.
|
||||
const derivedTenantApiKey = createStoredApiKeyFixture({ tenant: { id: "tenant_5", name: "Derived", slug: "derived", deactivatedReason: null } });
|
||||
|
||||
expect(getApiRuntimeConfig()).toMatchObject({ apiAccessToken: "tenant-2-service", jwtSecret: "tenant-2-secret" });
|
||||
expect(apiKey).toMatchObject({ tenantId: "tenant_2", tenant: { id: "tenant_2" } });
|
||||
expect(mismatchedApiKey).toMatchObject({ tenantId: "tenant_2", tenant: { id: "tenant_3" } });
|
||||
expect(row).toMatchObject({ id: "row_tenant_2", tenantId: "tenant_2" });
|
||||
expect(derivedTenantApiKey).toMatchObject({ tenantId: "tenant_5", tenant: { id: "tenant_5" } });
|
||||
});
|
||||
|
||||
test("resets runtime config patches after each test via installed hooks", () => {
|
||||
@@ -87,7 +71,6 @@ describe("api-key isolation fixtures", () => {
|
||||
origins: { web: "https://web.tenant-2.test" },
|
||||
analytics: { token: "analytics_tenant2" },
|
||||
mailjet: { webhookSecret: "mailer_tenant2_whsec" },
|
||||
stripe: { secretKey: "sk_test_tenant2", webhookSigningSecret: "whsec_tenant2" },
|
||||
storage: { bucket: "tenant-2-bucket", region: "eu-central-1" },
|
||||
});
|
||||
|
||||
@@ -99,7 +82,6 @@ describe("api-key isolation fixtures", () => {
|
||||
origins: { web: "https://web.tenant-2.test" },
|
||||
analytics: { token: "analytics_tenant2" },
|
||||
mailjet: { webhookSecret: "mailer_tenant2_whsec" },
|
||||
stripe: { secretKey: "sk_test_tenant2", webhookSigningSecret: "whsec_tenant2" },
|
||||
storage: { bucket: "tenant-2-bucket", region: "eu-central-1" },
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user