mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
test(cloud): SEC-4 window test re-mints tokens; fixture activity newest first
This commit is contained in:
@@ -140,10 +140,12 @@ describe('activity window and pagination', () => {
|
||||
const { h, admin, put, activity } = await setup()
|
||||
await put('org', 'OLD_VAR', VALUES[1]!, admin)
|
||||
h.advance(ACTIVITY_WINDOW_MS - 1_000)
|
||||
await put('org', 'NEW_VAR', VALUES[1]!, admin)
|
||||
expect((await activity(admin)).body.events.map((e: any) => e.name)).toEqual(['NEW_VAR', 'OLD_VAR'])
|
||||
// Tokens live 5 minutes: mint new ones as the clock jumps.
|
||||
const later = await h.token('alice', 'acme', 'sandbox', { org_role: 'admin' })
|
||||
await put('org', 'NEW_VAR', VALUES[1]!, later)
|
||||
expect((await activity(later)).body.events.map((e: any) => e.name)).toEqual(['NEW_VAR', 'OLD_VAR'])
|
||||
h.advance(2_000)
|
||||
expect((await activity(admin)).body.events.map((e: any) => e.name)).toEqual(['NEW_VAR'])
|
||||
expect((await activity(later)).body.events.map((e: any) => e.name)).toEqual(['NEW_VAR'])
|
||||
})
|
||||
|
||||
it('pages newest first with a cursor, including many events in the same millisecond', async () => {
|
||||
|
||||
@@ -147,9 +147,9 @@ export const FIXTURE_TEAM_ACTIVITY: CloudSecretEvent[] = [
|
||||
]
|
||||
|
||||
export const FIXTURE_PERSONAL_ACTIVITY: CloudSecretEvent[] = [
|
||||
event(11, 'created', 'personal', 'OPENROUTER_API_KEY', 8),
|
||||
event(13, 'created', 'personal', 'ANTHROPIC_API_KEY', 2),
|
||||
event(12, 'updated', 'personal', 'AWS_SECRET_ACCESS_KEY', 6),
|
||||
event(13, 'created', 'personal', 'ANTHROPIC_API_KEY', 2)
|
||||
event(11, 'created', 'personal', 'OPENROUTER_API_KEY', 8)
|
||||
]
|
||||
|
||||
export const FIXTURE_NAMES: Record<string, string> = { u_dana: 'Dana Reyes', u_ravi: 'Ravi Shah' }
|
||||
|
||||
Reference in New Issue
Block a user