[Security Solution][Resolver]Enzyme test related events closing (#74811)

This commit is contained in:
Brent Kimmel 2020-08-12 11:56:05 -04:00 committed by GitHub
parent 0e5ac40b00
commit 34195271c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
});
});
});