From 4e253e63651d193f2b4ed5b3a2cf70b972eb1569 Mon Sep 17 00:00:00 2001 From: Myllaume Date: Fri, 20 Sep 2024 09:40:19 +0200 Subject: [PATCH] test: selected node highlight --- e2e/graph.cy.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/e2e/graph.cy.js b/e2e/graph.cy.js index 7f66e9e5..0a09ade1 100644 --- a/e2e/graph.cy.js +++ b/e2e/graph.cy.js @@ -94,6 +94,19 @@ describe('graph', () => { cy.get('[data-node] text').should('have.attr', 'font-size', 10); }); + it('should highlight selected node and connected links', () => { + cy.visit('temp/citeproc.html#evergreen notes'); + + const highlightNodes = ['evergreen notes']; + + cy.get('[data-node].highlight').should('have.length', highlightNodes.length); + highlightNodes.forEach((name) => + cy.get(`[data-node="${name}"]`).should('have.class', 'highlight'), + ); + + cy.get('[data-link].highlight').should('have.length', 4); + }); + it('should highlight selected node, hovered node and connected nodes, links', () => { cy.get('[data-node], [data-link]').should('not.have.class', 'highlight');