Skip to content

Commit

Permalink
ADM-728 [frontend] test: add test for select classification
Browse files Browse the repository at this point in the history
  • Loading branch information
xuebing authored and lxuebing committed Jan 16, 2024
1 parent c141a11 commit 3fe9c6a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/__tests__/src/containers/ReportStep/ReportStep.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import { render, renderHook, screen, waitFor } from '@testing-library/react';
import ReportStep from '@src/containers/ReportStep';
import {
BACK,
BOARD_METRICS_TITLE,
CLASSIFICATION,
EMPTY_REPORT_VALUES,
ERROR_PAGE_ROUTE,
EXPORT_BOARD_DATA,
EXPORT_METRIC_DATA,
EXPORT_PIPELINE_DATA,
LEAD_TIME_FOR_CHANGES,
MOCK_DATE_RANGE,
MOCK_JIRA_VERIFY_RESPONSE,
MOCK_REPORT_RESPONSE,
Expand Down Expand Up @@ -153,6 +156,18 @@ describe('Report Step', () => {
expect(screen.getAllByTestId('loading-page')).toHaveLength(6);
});

it('should render detail page when metrics only select classification', () => {
setup([CLASSIFICATION]);

expect(screen.getByText(BACK)).toBeInTheDocument();
});

it('should render report page when board metrics select classification and dora metrics has value too', () => {
setup([CLASSIFICATION, LEAD_TIME_FOR_CHANGES]);

expect(screen.getByText(BOARD_METRICS_TITLE)).toBeInTheDocument();
});

it('should render the velocity component with correct props', async () => {
setup([REQUIRED_DATA_LIST[1]]);

Expand Down
2 changes: 2 additions & 0 deletions frontend/__tests__/src/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export const SHOW_MORE = 'show more >';

export const BACK = 'Back';

export const BOARD_METRICS_TITLE = 'Board Metrics';

export const VERIFY = 'Verify';

export const RESET = 'Reset';
Expand Down

0 comments on commit 3fe9c6a

Please sign in to comment.