Skip to content

Commit cb1f9eb

Browse files
committed
fix(test): mock db.select and drizzle and for workspace permissions check
1 parent 2c1b3bb commit cb1f9eb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/sim/lib/copilot/chat/post.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ vi.mock('@sim/db', () => ({
9393
})),
9494
})),
9595
})),
96+
select: vi.fn(() => ({
97+
from: vi.fn(() => ({
98+
where: vi.fn(() => ({
99+
limit: vi.fn().mockResolvedValue([{ permissionType: 'write' }]),
100+
})),
101+
})),
102+
})),
96103
},
97104
}))
98105

99106
vi.mock('drizzle-orm', () => ({
107+
and: vi.fn(() => ({})),
100108
eq: vi.fn(() => ({})),
101109
sql: (strings: TemplateStringsArray, ...values: unknown[]) => ({ strings, values }),
102110
}))

0 commit comments

Comments
 (0)