-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
@@ -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>) => { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security) |
There was a problem hiding this 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
x-pack/plugins/cloud_security_posture/public/pages/findings/findings_flyout/findings_flyout.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/cloud_security_posture/public/pages/findings/layout/findings_layout.tsx
Outdated
Show resolved
Hide resolved
.../cloud_security_posture/public/pages/findings/latest_findings/latest_findings_table.test.tsx
Outdated
Show resolved
Hide resolved
505619b
to
f1791d3
Compare
b6f2d07
to
5b647ee
Compare
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
(cherry picked from commit cfe91b1)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Summary
Closes #140491
add a test case for checking visibility of flyout after toggling