[Security Solution][Resolver]Enzyme test related events closing (#74811)
This commit is contained in:
parent
0e5ac40b00
commit
34195271c5
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue