Skip to content

Commit 93df236

Browse files
committed
add test of fullscren disable through 'f' key after enable with button
1 parent b884a65 commit 93df236

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

cypress/e2e/fullscreen_graph.spec.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,37 @@ describe('Show graph only mode', function () {
6666
cy.toolbar().should('exist');
6767
cy.canvas().invoke('width').should('be.lt', viewportWidth / 2)
6868
});
69+
70+
it('Shows the graph only when the open in full button is clicked and shows the full application again when the \'f\' key is pressed', function () {
71+
cy.startCleanApplication();
72+
cy.clearAndRenderDotSource('digraph {Alice -> Bob}');
73+
74+
cy.node(1).should('exist');
75+
cy.node(2).should('exist');
76+
cy.edge(1).should('exist');
77+
78+
cy.node(1).shouldHaveName('Alice');
79+
cy.node(2).shouldHaveName('Bob');
80+
cy.edge(1).shouldHaveName('Alice->Bob');
81+
82+
cy.nodes().should('have.length', 2);
83+
cy.edges().should('have.length', 1);
84+
85+
cy.textEditorWrapper().should('be.visible');
86+
cy.toolbar().should('exist');
87+
cy.canvas().invoke('width').should('be.lt', viewportWidth / 2)
88+
89+
cy.canvas().click();
90+
cy.fullscreenButton().click();
91+
92+
cy.textEditorWrapper().should('not.be.visible');
93+
cy.toolbar().should('not.exist');
94+
cy.canvas().invoke('width').should('be.eq', viewportWidth)
95+
96+
cy.get('body').type('f');
97+
98+
cy.textEditorWrapper().should('be.visible');
99+
cy.toolbar().should('exist');
100+
cy.canvas().invoke('width').should('be.lt', viewportWidth / 2)
101+
});
69102
});

0 commit comments

Comments
 (0)