Hi I am developing web application in angular. I have below code to open modal popup.
this.formResetToggle = false;
setTimeout(() => {
this.formResetToggle = true;
this.editorModal.show();
});
I have written unit test case for the above modal to open the popup.
it('open modal', () => {
expect(component.editorModal.isShown).toBe(false);
component.addScope();
expect(component.editorModal.isShown).toBe(true);
});
Initially editorModal.isShown will be false and when the modal is open editorModal.isShown will be true. This code works only when I remove settimeout from the addUser function. May I know what is reason and how can I fix this? Any help would be appreciated. Thank you.