fix(editor): Fix memory leak in Node Detail View by correctly unsubscribing from event buses (#6021)

This commit is contained in:
OlegIvaniv
2023-04-20 12:26:14 +02:00
committed by GitHub
parent 41660d9e28
commit 0970ec066d
13 changed files with 98 additions and 97 deletions

View File

@@ -12,11 +12,12 @@ describe('Data transformation expressions', () => {
beforeEach(() => {
wf.actions.visit();
cy.window()
// @ts-ignore
.then(
(win) => win.onBeforeUnloadNodeView && win.removeEventListener('beforeunload', win.onBeforeUnloadNodeView),
);
cy.window().then(
(win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
},
);
});
it('$json + native string methods', () => {

View File

@@ -17,11 +17,12 @@ describe('Data mapping', () => {
beforeEach(() => {
workflowPage.actions.visit();
cy.window()
// @ts-ignore
.then(
(win) => win.onBeforeUnloadNodeView && win.removeEventListener('beforeunload', win.onBeforeUnloadNodeView),
);
cy.window().then(
(win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
},
);
});
it('maps expressions from table header', () => {

View File

@@ -99,11 +99,12 @@ describe('Webhook Trigger node', async () => {
beforeEach(() => {
workflowPage.actions.visit();
cy.window()
// @ts-ignore
.then(
(win) => win.onBeforeUnloadNodeView && win.removeEventListener('beforeunload', win.onBeforeUnloadNodeView),
);
cy.window().then(
(win) => {
// @ts-ignore
win.preventNodeViewBeforeUnload = true;
},
);
});
it('should listen for a GET request', () => {