Skip to content

Commit

Permalink
Test update
Browse files Browse the repository at this point in the history
  • Loading branch information
duke-b committed Apr 3, 2024
1 parent 623b5a0 commit 3a671f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ describe('BenchmarkGridItem', () => {
it('should show the benchmark returned from the server', async () => {
const { queryByText } = await renderBenchmarkGridItem();

expect(queryByText('On-demand')).not.toBeNull();
expect(queryByText('On-demand', { exact: false })).not.toBeNull();
});

it('should show loading indicator when waiting on the benchmark to return', async () => {
delayRequest({ key: 'on-demand' }, benchmarkUrl);
delayRequest({ key: 'week-elite', value: '3' }, benchmarkUrl);

const { queryByText, queryByRole, findByRole } =
await renderBenchmarkGridItem();

expect(await findByRole('progressbar')).not.toBeNull();
expect(queryByText('On-demand')).toBeNull();
expect(queryByText('3 deployment days per week(elite)')).toBeNull();

await act(async () => {
jest.runAllTimers();
});

expect(queryByRole('progressbar')).toBeNull();
expect(queryByText('On-demand')).not.toBeNull();
expect(queryByText('3 deployment days per week(elite)')).not.toBeNull();
});

it('should show the error returned from the service', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ describe('DashboardComponent', () => {
expect(queryByText('Deployment Frequency Average')).toBeInTheDocument();
expect(queryByText('df_average_first_key')).toBeInTheDocument();

expect(queryByText('Median Lead Time for Changes')).toBeInTheDocument();
expect(
queryByText('Median Lead Time for Changes in Hours'),
).toBeInTheDocument();
expect(queryAllByText('mltc_first_key')[0]).toBeInTheDocument();

expect(queryAllByText('Change Failure Rate')).toHaveLength(2);
expect(queryAllByText('cfr_first_key')[0]).toBeInTheDocument();

expect(queryAllByText('Mean Time to Recovery')).toHaveLength(2);
expect(
queryAllByText('Mean Time to Restore Service in Hours'),
).toHaveLength(1);
expect(queryAllByText('mttr_first_key')[0]).toBeInTheDocument();
});

Expand Down

0 comments on commit 3a671f1

Please sign in to comment.