test(realtime): isolate credential attempt budgets between cases

This commit is contained in:
404oops authored and GitHub committed 2026-11-05 10:23:47 -07:00
1 parent 1ab1c04760
commit 2832926f8d
1 file changed
+5 -1
@@ -210,7 +210,11 @@ describe('OpenAIRealtimeRelayService relay', () => {
// Realtime is subscriber-only; the test user is on a paid plan with a $10
// allowance unless a test says otherwise.
beforeEach(() => {
beforeEach(async () => {
const row = await server.stores.user.getByUsername(user.username);
user.token = (
await server.services.auth.createSessionToken(row!, {})
).token;
const metering = server.services.metering;
const plan = metering.getActorSubscription.bind(metering);
vi.spyOn(metering, 'getActorSubscription').mockImplementation(