Skip to content

Commit

Permalink
[Security Solution][Resolver]Enzyme test related events closing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Kimmel committed Aug 11, 2020
1 parent 7d3a1ff commit 76fac30
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,28 @@ describe('Resolver, when analyzing a tree that has two related events for the or
button.simulate('click');
}
});
it('should open the submenu', async () => {
it('should open the submenu and display exactly one option with the correct count', async () => {
await expect(
simulator.map(() => simulator.processNodeSubmenuItems().map((node) => node.text()))
).toYieldEqualTo(['2 registry']);
await expect(
simulator.map(() => simulator.processNodeSubmenuItems().length)
).toYieldEqualTo(1);
});
});
describe('and when the related events button is clicked again', () => {
beforeEach(async () => {
const button = await simulator.resolveWrapper(() =>
simulator.processNodeRelatedEventButton(entityIDs.origin)
);
if (button) {
button.simulate('click');
}
});
it('should close the submenu', async () => {
await expect(
simulator.map(() => simulator.processNodeSubmenuItems().length)
).toYieldEqualTo(0);
});
});
});
Expand Down

0 comments on commit 76fac30

Please sign in to comment.