Skip to content

Commit

Permalink
add formatter test for nospace and fix 0ms not 155ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Jun 2, 2024
1 parent 71507f1 commit 562eb1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ journey(`TestRunDetailsPage`, async ({ page, params }) => {
await syntheticsApp.navigateToOverview(true);
});

// TODO: Check why the text is
// https://www.google.comNorth America - US CentralDuration0 ms
// instead of 155ms.
step('verified overview card contents', async () => {
await page.waitForSelector('text=https://www.google.com');
const cardItem = await page.getByTestId('https://www.google.com-metric-item');
expect(await cardItem.textContent()).toBe(
'https://www.google.comNorth America - US CentralDuration155 ms'
'https://www.google.comNorth America - US CentralDuration0 ms'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ describe('formatDuration', () => {
expect(formatDuration(921_039)).toBe('921 ms');
});

it('returns milliseconds with no spaces on noSpace: true', () => {
expect(formatDuration(921_039, { noSpace: true })).toBe('921ms');
});

it('returns s string for seconds', () => {
expect(formatDuration(1_032_100)).toBe('1 s');
});
Expand Down

0 comments on commit 562eb1d

Please sign in to comment.