Skip to content

Commit

Permalink
Merge pull request #177 from nkongsuwan/fix-challenge-test
Browse files Browse the repository at this point in the history
fix challenge.test.ts
  • Loading branch information
lenkan authored Dec 15, 2023
2 parents 421232d + d421454 commit a541d94
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/integration-scripts/challenge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ test('challenge', async () => {

// List Client 1 contacts
let contacts1 = await client1.contacts().list();
expect(contacts1[0].alias).toEqual('bob');
expect(contacts1[0].challenges).toHaveLength(0);
let bobContact = contacts1.find(
(contact: { alias: string }) => contact.alias === 'bob'
);
expect(bobContact.alias).toEqual('bob');
expect(bobContact.challenges).toHaveLength(0);

// Bob responds to Alice challenge
await client2.challenges().respond('bob', aid1.i, challenge1_small.words);
Expand All @@ -119,5 +122,8 @@ test('challenge', async () => {

// Check Bob's challenge in conctats
contacts1 = await client1.contacts().list();
expect(contacts1[0].challenges[0].authenticated).toEqual(true);
bobContact = contacts1.find(
(contact: { alias: string }) => contact.alias === 'bob'
);
expect(bobContact.challenges[0].authenticated).toEqual(true);
}, 30000);

0 comments on commit a541d94

Please sign in to comment.