Skip to content

Commit

Permalink
Wait for some time for the client list to update
Browse files Browse the repository at this point in the history
Signed-off-by: eternal-flame-AD <[email protected]>
  • Loading branch information
eternal-flame-AD committed Nov 3, 2024
1 parent 7db86af commit e927ae8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ enum Col {
Delete = 5,
}

const hasClient =
const waitForClient =
(name: string, row: number): (() => Promise<void>) =>
async () => {
expect(await innerText(page, $table.cell(row, Col.Name))).toBe(name);
await waitForExists(page, $table.cell(row, Col.Name), name);
};

const updateClient =
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Client', () => {
expect(await innerText(page, $table.cell(3, Col.Name))).toBe('desktop app');
});
it('updates client', updateClient(1, {name: 'firefox'}));
it('has updated client name', hasClient('firefox', 1));
it('has updated client name', waitForClient('firefox', 1));
it('shows token', async () => {
await page.click($table.cell(3, Col.Token, '.toggle-visibility'));
expect((await innerText(page, $table.cell(3, Col.Token))).startsWith('C')).toBeTruthy();
Expand Down

0 comments on commit e927ae8

Please sign in to comment.