Skip to content

Commit

Permalink
Added additional tests for validating no timeline button on managemen…
Browse files Browse the repository at this point in the history
…t views
  • Loading branch information
paul-tavares committed Jun 25, 2020
1 parent 0e63342 commit 811e45b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ describe('when on the hosts page', () => {
render = () => mockedContext.render(<HostList />);
});

it('should NOT display timeline', async () => {
const renderResult = render();
const timelineFlyout = await renderResult.queryByTestId('flyoutOverlay');
expect(timelineFlyout).toBeNull();
});

it('should show a table', async () => {
const renderResult = render();
const table = await renderResult.findByTestId('hostListTable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ describe('Policy Details', () => {
policyView = render(<PolicyDetails />);
});

it('should NOT display timeline', async () => {
expect(policyView.find('flyoutOverlay')).toHaveLength(0);
});

it('should show loader followed by error message', () => {
expect(policyView.find('EuiLoadingSpinner').length).toBe(1);
policyView.update();
Expand Down Expand Up @@ -84,6 +88,10 @@ describe('Policy Details', () => {
policyView = render(<PolicyDetails />);
});

it('should NOT display timeline', async () => {
expect(policyView.find('flyoutOverlay')).toHaveLength(0);
});

it('should display back to list button and policy title', () => {
policyView.update();
const pageHeaderLeft = policyView.find(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ describe('when on the policies page', () => {
render = () => mockedContext.render(<PolicyList />);
});

it('should NOT display timeline', async () => {
const renderResult = render();
const timelineFlyout = await renderResult.queryByTestId('flyoutOverlay');
expect(timelineFlyout).toBeNull();
});

it('should show the empty state', async () => {
const renderResult = render();
const table = await renderResult.findByTestId('emptyPolicyTable');
Expand Down

0 comments on commit 811e45b

Please sign in to comment.