From e14dc883d91b63dd153d97bfca65d4cf5db6d7b4 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 26 Sep 2019 13:31:53 +0530 Subject: [PATCH 1/2] fix: update in cypress tests: list_view.js --- cypress/integration/list_view.js | 13 +++++++------ frappe/public/js/frappe/list/list_view.js | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cypress/integration/list_view.js b/cypress/integration/list_view.js index 1cf7f4e6d8..9b3efd3b8e 100644 --- a/cypress/integration/list_view.js +++ b/cypress/integration/list_view.js @@ -19,13 +19,14 @@ context('List View', () => { cy.route({ method: 'POST', url:'api/method/frappe.model.workflow.bulk_workflow_approval' - }).as('bulk-approval'); - cy.route({ - method: 'GET', - url:'api/method/frappe.desk.reportview.get*' - }).as('update-list'); + }).then(()=> { + cy.route({ + method: 'POST', + url:'api/method/frappe.desk.reportview.get' + }) + }).as('update-view'); cy.wrap(elements).contains('Approve').click(); - cy.wait(['@bulk-approval', '@update-list']); + cy.wait('@update-view'); cy.get('.list-row-container:visible').should('contain', 'Approved'); }); }); diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index d63cabfbfe..8753caff2f 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -129,7 +129,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { this.toggle_auto_refresh(false), item.action, this.toggle_auto_refresh(true) - ]) + ]); } const $item = this.page.add_actions_menu_item(item.label, action, item.standard); if (item.class) { From 86d549b11826b9c6056a7f78c4917048a8ca29e0 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 26 Sep 2019 19:11:19 +0530 Subject: [PATCH 2/2] fix: list_view.js cypress tests update --- cypress/integration/list_view.js | 13 ++++++------- frappe/public/js/frappe/list/list_view.js | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cypress/integration/list_view.js b/cypress/integration/list_view.js index 9b3efd3b8e..8d37b19c89 100644 --- a/cypress/integration/list_view.js +++ b/cypress/integration/list_view.js @@ -19,14 +19,13 @@ context('List View', () => { cy.route({ method: 'POST', url:'api/method/frappe.model.workflow.bulk_workflow_approval' - }).then(()=> { - cy.route({ - method: 'POST', - url:'api/method/frappe.desk.reportview.get' - }) - }).as('update-view'); + }).as('bulk-approval'); + cy.route({ + method: 'POST', + url:'api/method/frappe.desk.reportview.get' + }).as('real-time-update'); cy.wrap(elements).contains('Approve').click(); - cy.wait('@update-view'); + cy.wait(['@bulk-approval', '@real-time-update']); cy.get('.list-row-container:visible').should('contain', 'Approved'); }); }); diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 8753caff2f..07055482b2 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -1041,7 +1041,6 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { // in the listview according to filters applied // let's remove it manually this.data = this.data.filter(d => d.name !== name); - this.$result.find('.list-row-container').remove(); this.render_list(); return; }