Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cloud Security] Update mock server timeout config #187119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ describe('<Findings />', () => {
// Loading while checking the status API
expect(screen.getByText(/loading/i)).toBeInTheDocument();

await waitFor(() =>
expect(screen.getByTestId('latest_findings_container')).toBeInTheDocument()
);
// loading findings
await waitFor(() => expect(screen.getByText(/loading results/i)).toBeInTheDocument());

await waitFor(() => expect(screen.getByText(/2 findings/i)).toBeInTheDocument());

expect(screen.getByText(finding1.resource.name)).toBeInTheDocument();
Expand Down Expand Up @@ -99,12 +93,6 @@ describe('<Findings />', () => {
// Loading while checking the status API
expect(screen.getByText(/loading/i)).toBeInTheDocument();

await waitFor(() =>
expect(screen.getByTestId('latest_findings_container')).toBeInTheDocument()
);
// loading findings
await waitFor(() => expect(screen.getByText(/loading results/i)).toBeInTheDocument());

await waitFor(() => expect(screen.getByText(/2 findings/i)).toBeInTheDocument());

const queryInput = screen.getByTestId('queryInput');
Expand Down Expand Up @@ -134,12 +122,6 @@ describe('<Findings />', () => {
// Loading while checking the status API
expect(screen.getByText(/loading/i)).toBeInTheDocument();

await waitFor(() =>
expect(screen.getByTestId('latest_findings_container')).toBeInTheDocument()
);
// loading findings
await waitFor(() => expect(screen.getByText(/loading results/i)).toBeInTheDocument());

await waitFor(() => expect(screen.getByText(/2 findings/i)).toBeInTheDocument());

const queryInput = screen.getByTestId('queryInput');
Expand Down Expand Up @@ -171,12 +153,6 @@ describe('<Findings />', () => {
// Loading while checking the status API
expect(screen.getByText(/loading/i)).toBeInTheDocument();

await waitFor(() =>
expect(screen.getByTestId('latest_findings_container')).toBeInTheDocument()
);
// loading findings
await waitFor(() => expect(screen.getByText(/loading results/i)).toBeInTheDocument());

await waitFor(() => expect(screen.getByText(/2 findings/i)).toBeInTheDocument());

userEvent.click(screen.getByTestId('addFilter'), undefined, { skipPointerEventsCheck: true });
Expand Down Expand Up @@ -212,7 +188,7 @@ describe('<Findings />', () => {
await waitFor(() => expect(screen.getByText(/1 findings/i)).toBeInTheDocument());
expect(screen.getByText(finding1.resource.name)).toBeInTheDocument();
expect(screen.queryByText(finding2.resource.id)).not.toBeInTheDocument();
}, 10000);
});
it('remove filter', async () => {
const finding1 = generateCspFinding('0001', 'failed');
const finding2 = generateCspFinding('0002', 'passed');
Expand Down Expand Up @@ -256,12 +232,6 @@ describe('<Findings />', () => {
// Loading while checking the status API
expect(screen.getByText(/loading/i)).toBeInTheDocument();

await waitFor(() =>
expect(screen.getByTestId('latest_findings_container')).toBeInTheDocument()
);
// loading findings
await waitFor(() => expect(screen.getByText(/loading results/i)).toBeInTheDocument());

await waitFor(() => expect(screen.getByText(/1 findings/i)).toBeInTheDocument());
expect(screen.getByText(finding1.resource.name)).toBeInTheDocument();
expect(screen.queryByText(finding2.resource.id)).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jest.mock('rxjs', () => {
};
});

// Set the default timeout for all mock server tests to 30 seconds
jest.setTimeout(10 * 3000);

/**
* Setup a mock server with the default handlers
* @param debug - If true, log all requests to the console
Expand Down