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 Posture] add tests for findings flyout toggling #150551

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

orouz
Copy link
Contributor

@orouz orouz commented Feb 8, 2023

Summary

Closes #140491

add a test case for checking visibility of flyout after toggling

@orouz orouz added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Cloud Security Cloud Security team related v8.7.0 labels Feb 8, 2023
@@ -19,21 +19,40 @@ const chance = new Chance();
type TableProps = PropsOf<typeof FindingsTable>;

describe('<FindingsTable />', () => {
it('renders the zero state when status success and data has a length of zero ', async () => {
const renderWrapper = (opts?: Partial<TableProps>) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this to simplify all tests in file

@@ -66,23 +75,12 @@ describe('<FindingsTable />', () => {

it('adds filter with a cell button click', () => {
const names = chance.unique(chance.sentence, 10);
const data = names.map(getFindingsFixture);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getFindingsFixture doesn't take any arguments so we're not using the unique names anymore. this used fail on CI because sometimes our tests would find identical strings. changed this to include unique rule names

it('opens/closes the flyout when clicked on expand/close buttons ', () => {
renderWrapper({ items: [getFindingsFixture()] });

expect(screen.queryByTestId('findings_flyout')).not.toBeInTheDocument();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turns out we need to use queryByTestId and not getByTestId for .not stuff because it throws.

@orouz orouz marked this pull request as ready for review February 8, 2023 13:09
@orouz orouz requested a review from a team as a code owner February 8, 2023 13:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

Copy link
Contributor

@JordanSh JordanSh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply changes before merging

@orouz orouz force-pushed the csp_findings_flyout_toggle_test branch from 505619b to f1791d3 Compare February 21, 2023 07:37
@orouz orouz force-pushed the csp_findings_flyout_toggle_test branch from b6f2d07 to 5b647ee Compare February 22, 2023 06:22
@orouz orouz enabled auto-merge (squash) February 22, 2023 06:22
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 145.2KB 145.3KB +83.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@orouz orouz merged commit cfe91b1 into elastic:main Feb 22, 2023
@opauloh opauloh added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) backport:skip This commit does not require backporting and removed backport:skip This commit does not require backporting backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Mar 23, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 23, 2023
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.7

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v8.7.0 v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cloud Posture] Add tests for Findings Flyout (incl. JSON)
6 participants