Skip to content

Commit

Permalink
Removing unneccesary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ananya-agarwal committed Jun 22, 2024
1 parent 01582d9 commit 98d5097
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,21 @@ describe('MetricsComponent', () => {
test('selecting a specific metric from the dropdown filters the data using click events', async () => {
render(<MetricsComponent />);

// Wait for data to load and ensure any option like 'queries.number' is present
await waitFor(() => screen.getByText('queries.number'));

const select = screen.getByTestId('metric-select').firstElementChild;
if (select) {
fireEvent.mouseDown(select);
}

// Query for the dropdown menu which is now in the document
const dropdown = document.querySelector('.ant-select');

// Choose any option like the 1st from the metrics and then click on it
const secondOption = dropdown?.querySelectorAll('.ant-select-item')[1];
if (secondOption) {
fireEvent.click(secondOption);
await waitFor(() => {
const headings = screen.queryAllByRole('heading', { level: 4 });
expect(headings).toHaveLength(1); // This should fail if the filter does not work
expect(headings).toHaveLength(1);
});
}
});
Expand Down

0 comments on commit 98d5097

Please sign in to comment.