Skip to content

Commit

Permalink
fix: flaky Org Chart Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed Oct 16, 2021
1 parent f3cf36f commit 6d5cce0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/test_organizational_chart_desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ context('Organizational Chart', () => {
cy.get('.frappe-control[data-fieldname=company] input').focus().as('input');
cy.get('@input')
.clear({ force: true })
.type('Test Org Chart{enter}', { force: true })
.type('Test Org Chart{downarrow}{enter}', { force: true })
.blur({ force: true });
});
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/test_organizational_chart_mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Organizational Chart Mobile', () => {
cy.get('.frappe-control[data-fieldname=company] input').focus().as('input');
cy.get('@input')
.clear({ force: true })
.type('Test Org Chart{enter}', { force: true })
.type('Test Org Chart{downarrow}{enter}', { force: true })
.blur({ force: true });
});
});
Expand Down
10 changes: 6 additions & 4 deletions erpnext/public/js/hierarchy_chart/hierarchy_chart_desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,12 @@ erpnext.HierarchyChart = class {

if (child_nodes) {
$.each(child_nodes, (_i, data) => {
this.add_node(node, data);
setTimeout(() => {
this.add_connector(node.id, data.id);
}, 250);
if (!$(`[id="${data.id}"]`).length) {
this.add_node(node, data);
setTimeout(() => {
this.add_connector(node.id, data.id);
}, 250);
}
});
}
}
Expand Down

0 comments on commit 6d5cce0

Please sign in to comment.