Skip to content

Commit

Permalink
[Security Solution][Resolver]Enzyme test related events closing (#74811
Browse files Browse the repository at this point in the history
…) (#74999)
  • Loading branch information
bkimmel authored Aug 14, 2020
1 parent 357e0e0 commit d32d9fd
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 d32d9fd

Please sign in to comment.