e2e-prod: platform wallet adjust route, fund scenario player, RCs seeded directly in prod env
CI / check (push) Successful in 58s
CI / publish (push) Has been skipped

This commit is contained in:
edmand46
2026-08-20 11:35:21 +03:00
parent 322a2c0706
commit 1013f2395f
3 changed files with 23 additions and 7 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, beforeAll, vi } from 'vitest';
import { loadArtifact, makeProdClient } from './_setup/harness.js';
import { adminApi, loadArtifact, makeProdClient } from './_setup/harness.js';
import type { SeedArtifact } from './_setup/types.js';
import type { NotificationEffect, StoreOfferEffect } from '../../src/index.js';
import { getScenarioRuntime } from '../../src/client/RudderClient.js';
@@ -30,6 +30,17 @@ describe('e2e-prod: scenarios', () => {
};
await client.auth.loginWithDevice({ region: 'en', language: 'en' });
// The boundary buy uses the paid offer — fund the wallet so the purchase succeeds.
const playerId = (await client.player.reload()).player!.id!;
await adminApi(artifact).post(
`/platform/v1/projects/${artifact.projectId}/players/${playerId}/wallet/adjust`,
{
currencyCode: artifact.store.paidPrice.currency,
amount: artifact.store.paidPrice.amount,
reason: 'e2e scenario funding',
},
);
// First notification dispatched.
await vi.waitFor(() => expect(notifications.length).toBe(1), { timeout: 10_000 });
await notifications[0].done();