Skip to content

Commit c58316a

Browse files
committed
Merge branch 'wip/fx7-ci-unit' into wip/platform-org-wiring
2 parents 33bf328 + 1512521 commit c58316a

7 files changed

Lines changed: 23 additions & 24 deletions

File tree

‎.github/workflows/platform-design.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ on:
3535
- 'apps/sim/lib/toast/**'
3636
- 'apps/sim/lib/core/application/**'
3737
- 'apps/sim/lib/core/config/block-visibility.ts'
38+
- 'apps/sim/lib/core/orchestration/types.ts'
3839
- 'apps/sim/lib/core/utils/deadline.ts'
40+
- 'apps/sim/lib/catalog/application/**'
41+
- 'apps/sim/lib/credentials/application/**'
3942
- 'apps/sim/lib/knowledge/application/**'
4043
- 'apps/sim/lib/knowledge/search/results.ts'
4144
- 'apps/sim/lib/users/application/**'
4245
- 'apps/sim/lib/workflows/application/**'
4346
- 'apps/sim/components/file-viewer/**'
4447
- 'apps/sim/components/dashboard-panel/**'
48+
- 'apps/sim/components/find-bar/**'
4549
- 'apps/sim/hooks/sim-search/**'
4650
- 'apps/sim/ee/**'
4751
- 'apps/sim/hooks/mothership-chat/**'

‎apps/sim/app/api/mothership/events/route.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ vi.mock('@/lib/mothership/chat/organization-chats', () => mothershipOrganization
2727
vi.mock('@/lib/mothership/chat-status', () => mothershipChatStatusMock)
2828
vi.mock('@/lib/workspaces/permissions/utils', () => permissionsMock)
2929

30-
import { GET } from '@/app/api/mothership/events/route'
30+
import { GET as routeGET } from '@/app/api/mothership/events/route'
3131

32+
const GET = (req: NextRequest) => routeGET(req, { params: Promise.resolve({}) })
3233
const authorize = mothershipOrganizationChatsMockFns.mockAuthorizeOrganizationChatEvents
3334
const subscribe = mothershipChatStatusMockFns.mockOnStatusChanged
3435

‎apps/sim/lib/billing/core/inbox-entitlement.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ beforeEach(() => {
3333
id: 'workspace-1',
3434
billedAccountUserId: 'payer-1',
3535
organizationId: null,
36+
teamOrganizationId: null,
3637
})
3738
mockGetPersonalSubscription.mockResolvedValue(null)
3839
mockGetOrganizationSubscription.mockResolvedValue(null)
@@ -86,6 +87,7 @@ describe('Sim Mailer hosted entitlement', () => {
8687
id: 'workspace-1',
8788
billedAccountUserId: 'payer-1',
8889
organizationId: 'org-1',
90+
teamOrganizationId: 'org-1',
8991
})
9092
dbChainMockFns.limit.mockResolvedValueOnce([{ plan, status: 'active' }])
9193
mockGetOrganizationSubscription.mockResolvedValue({ plan, status: 'active' })
@@ -140,6 +142,7 @@ describe('Sim Mailer cleanup uncertainty', () => {
140142
id: 'workspace-1',
141143
billedAccountUserId: 'payer-1',
142144
organizationId: 'org-1',
145+
teamOrganizationId: 'org-1',
143146
})
144147
mockGetOrganizationSubscription.mockResolvedValue({ plan: 'team_25000', status: 'past_due' })
145148

‎apps/sim/lib/billing/core/subscription.integration.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ vi.mock('@/lib/workspaces/permissions/utils', () => ({
3232
id: 'fixture-workspace',
3333
billedAccountUserId: 'fixture-owner',
3434
organizationId: fixture.organizationId,
35+
teamOrganizationId: fixture.organizationId,
3536
}),
3637
}))
3738
vi.mock('@/lib/billing/core/access', () => ({

‎apps/sim/lib/billing/organization.test.ts‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
} from '@sim/testing/mocks/organization-membership.mock'
2525
import { schemaMock } from '@sim/testing/mocks/schema.mock'
2626
import { beforeEach, describe, expect, it, vi } from 'vitest'
27+
import type { DbTransaction } from '@/lib/db/types'
2728

2829
const {
2930
mockCreateOrganizationWithOwner,
@@ -77,6 +78,8 @@ const { mockAcquireOrganizationMutationLock } = organizationMembershipMockFns
7778
const { mockAcquireUserBillingIdentityLock } = billingIdentityLockMockFns
7879
const BILLING_WEBHOOK = { type: 'system', name: 'Billing System' } as const
7980
const ACCEPTOR = { type: 'user', userId: 'acceptor-1' } as const
81+
/** The chain mock standing in for the acceptance transaction the Tx variant runs on. */
82+
const ACCEPTANCE_TX = dbChainMock.db as unknown as DbTransaction
8083
billingPlanHelpersMockFns.mockIsPaid.mockImplementation((plan) => plan !== 'free')
8184

8285
function queueWhereResponses(responses: unknown[][]) {
@@ -175,7 +178,7 @@ describe('ensureOrganizationForTeamSubscription', () => {
175178
mockAttachOwnedWorkspacesToOrganizationTx.mockResolvedValueOnce({ usageLimitUserIds: [] })
176179

177180
await ensureOrganizationForTeamSubscriptionTx(
178-
dbChainMock.db,
181+
ACCEPTANCE_TX,
179182
{
180183
id: 'sub-1',
181184
plan: 'team',
@@ -204,7 +207,7 @@ describe('ensureOrganizationForTeamSubscription', () => {
204207

205208
await expect(
206209
ensureOrganizationForTeamSubscriptionTx(
207-
dbChainMock.db,
210+
ACCEPTANCE_TX,
208211
{
209212
id: 'sub-1',
210213
plan: 'team',
@@ -267,16 +270,13 @@ describe('syncSubscriptionUsageLimits', () => {
267270
mockGetOrganizationIdForSubscriptionReference.mockResolvedValue('org-1')
268271
mockGetPlanPricing.mockReturnValue({ basePrice: 25 })
269272

270-
await syncSubscriptionUsageLimits(
271-
{
272-
id: 'sub-1',
273-
plan: 'team_6000',
274-
referenceId: 'org-1',
275-
status: 'active',
276-
seats: 2,
277-
},
278-
BILLING_WEBHOOK
279-
)
273+
await syncSubscriptionUsageLimits({
274+
id: 'sub-1',
275+
plan: 'team_6000',
276+
referenceId: 'org-1',
277+
status: 'active',
278+
seats: 2,
279+
})
280280

281281
const update = dbChainMockFns.set.mock.calls[0]?.[0]
282282
const expression = JSON.stringify(update?.orgUsageLimit)

‎apps/sim/lib/uploads/contexts/organization-logo/application.integration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('organization logo concurrency and retention', () => {
7272
beforeAll(async () => {
7373
const connection = fixture.connection!
7474
await connection`CREATE SCHEMA ${connection(fixture.schema)}`
75-
for (const table of ['user', 'member', 'organization', 'upload_session']) {
75+
for (const table of ['user', 'member', 'organization', 'workspace', 'upload_session']) {
7676
await connection`CREATE TABLE ${connection(table)} (LIKE ${connection(`public.${table}`)} INCLUDING ALL)`
7777
}
7878
await db.insert(organization).values({

‎scripts/check-test-types.baseline.json‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,10 @@
231231
"apps/sim/app/api/mothership/chats/read/route.test.ts": {
232232
"TS2554": 3
233233
},
234-
"apps/sim/app/api/mothership/events/route.test.ts": {
235-
"TS2554": 10
236-
},
237234
"apps/sim/app/api/organizations/[id]/permission-groups/[groupId]/route.test.ts": {
238235
"TS2550": 2
239236
},
240237
"apps/sim/app/api/organizations/route.test.ts": {
241-
"TS2554": 3,
242238
"TS2769": 1
243239
},
244240
"apps/sim/app/api/pinned-items/route.test.ts": {
@@ -458,9 +454,6 @@
458454
"TS2322": 1,
459455
"TS2554": 1
460456
},
461-
"apps/sim/app/api/workspaces/route.test.ts": {
462-
"TS2554": 2
463-
},
464457
"apps/sim/background/async-execution-correlation.test.ts": {
465458
"TS2345": 2
466459
},
@@ -966,9 +959,6 @@
966959
"TS2345": 2,
967960
"TS2739": 16
968961
},
969-
"apps/sim/lib/billing/organization.test.ts": {
970-
"TS2345": 1
971-
},
972962
"apps/sim/lib/billing/organizations/lock-order.test.ts": {
973963
"TS2345": 2,
974964
"TS2352": 1,

0 commit comments

Comments
 (0)