diff --git a/cypress/integration/console.spec.js b/cypress/integration/console.spec.js index c74298f..88166a0 100644 --- a/cypress/integration/console.spec.js +++ b/cypress/integration/console.spec.js @@ -1,6 +1,7 @@ describe('draw a vector', () => { it('adds the svg vector', () => { cy.visit('http://localhost:8080'); + cy.get('#command_input').type("{enter}"); cy.get('#command_input').type("a = vector(0,0,0.5,0.5){enter}"); cy.get('#0').invoke('attr','d').should('eq','M550 350 L600 300'); @@ -18,8 +19,9 @@ describe('draw a vector', () => { describe('draw a lazy vector', () => { it('adds the svg vector', () => { cy.visit('http://localhost:8080'); + cy.get('#command_input').type("{enter}"); - cy.get('#command_input').type("a = vector(0,0,0.5,0.5){enter}"); + cy.get('#command_input').type("a = [0.5,0.5]{enter}"); cy.get('#0').invoke('attr','d').should('eq','M550 350 L600 300'); cy.get('#0').invoke('attr','class').should('eq','vector'); cy.get('#0').invoke('attr','marker-end').should('eq','url(#arrow)'); diff --git a/src/js/functions.js b/src/js/functions.js index b1b4285..3870467 100644 --- a/src/js/functions.js +++ b/src/js/functions.js @@ -70,10 +70,10 @@ const help = function () { a = [0.5, 0.5] b = [-1,1] c = "a+b" - a=a*2 + a = a*2 => when a is updated, c is too. - Now try dragging a using the mouse pointer and see what happens. - ` + Now try dragging a vector using the mouse pointer and see what happens. + (NB dragging c won't work, because it is lazy)` } }