Skip to content

Commit

Permalink
Fix unit test warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Mar 1, 2021
1 parent 1057529 commit 442dcdd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { act } from '@testing-library/react';
import React from 'react';

import { findTestSubject, mountWithIntl } from '@kbn/test/jest';
Expand Down Expand Up @@ -65,7 +66,7 @@ describe('PrivilegeSummary', () => {
expect(wrapper.find(PrivilegeSummaryTable)).toHaveLength(0);
});

it('clicking the button renders the privilege summary table', () => {
it('clicking the button renders the privilege summary table', async () => {
const kibanaPrivileges = createKibanaPrivileges(kibanaFeatures);

const role = createRole([
Expand All @@ -86,7 +87,10 @@ describe('PrivilegeSummary', () => {
/>
);

findTestSubject(wrapper, 'viewPrivilegeSummaryButton').simulate('click');
await act(async () => {
findTestSubject(wrapper, 'viewPrivilegeSummaryButton').simulate('click');
});
wrapper.update();
expect(wrapper.find(PrivilegeSummaryTable)).toHaveLength(1);
});
});

0 comments on commit 442dcdd

Please sign in to comment.