Skip to content

Commit

Permalink
At setup, create the admin User and pass it where needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jplodge-pro committed Jun 14, 2024
1 parent 44ed74d commit e987a8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/sdk/test/src/claim-yield-and-principal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Multi user deposit test similar to deposit.spec.ts
import { expect, test } from '@playwright/test';
import { BigNumber, Signer, ethers } from 'ethers';
import { BigNumber, ethers } from 'ethers';

import { whitelist } from './utils/admin';
import { signerFor } from './utils/api';
Expand All @@ -14,14 +14,17 @@ import { generateAddress, wait } from './utils/utils';

let config: any;
let testSigners: TestSigners;
let admin: User;
let alice: User;
let bob: User;

// NOTE (JL,2024-06-13): By experimentation, this is invoked before EVERY top-level `test`.
test.beforeAll('Setup', async () => {
config = loadConfiguration();

testSigners = new TestSigners(new ethers.providers.JsonRpcProvider(config.services.ethers.url));

admin = await userFor(config, config.users.admin.email_address, config.secret.ADMIN_PASSWORD, testSigners.admin);
alice = await userFor(config, config.users.alice.email_address, config.secret.ALICE_PASSWORD, testSigners.alice);
bob = await userFor(config, config.users.bob.email_address, config.secret.BOB_PASSWORD, testSigners.bob);

Expand Down Expand Up @@ -60,8 +63,8 @@ test.describe('Claim yield and principal - Fixed', async () => {
});

await test.step('Whitelist users', async () => {
await whitelist(config, alice.address, alice.id);
await whitelist(config, bob.address, bob.id);
await whitelist(config, admin, alice.address, alice.id);
await whitelist(config, admin, bob.address, bob.id);
});

vaultAddress = await test.step('Get vault and filter', async () => {
Expand Down

0 comments on commit e987a8f

Please sign in to comment.