updated cypress version and the test

This commit is contained in:
Sander Hautvast 2021-02-18 21:08:19 +01:00
parent 1ef889af68
commit fd9d1b550c
6 changed files with 45 additions and 10 deletions

View file

@ -2,9 +2,15 @@ describe('draw a vector', () => {
it('adds the svg vector', () => { it('adds the svg vector', () => {
cy.visit('http://localhost:8080'); cy.visit('http://localhost:8080');
cy.get('#command_input').type("a = vector(0,0,1,1){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 L650 250'); 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','class').should('eq','vector');
cy.get('#0').invoke('attr','marker-end').should('eq','url(#arrow)'); cy.get('#0').invoke('attr','marker-end').should('eq','url(#arrow)');
cy.get('#command_input').type("b = vector(0,0,-1,1){enter}");
cy.get('#1').invoke('attr','d').should('eq','M550 350 L450 250');
cy.get('#command_input').type("c = a + b{enter}");
cy.get('#2').invoke('attr','d').should('eq','M550 350 L500 200');
}) })
}) })

7
cypress/plugins/index.js Normal file
View file

@ -0,0 +1,7 @@
/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}

2
cypress/support/index.js Normal file
View file

@ -0,0 +1,2 @@
// import './commands'

30
package-lock.json generated
View file

@ -1507,14 +1507,15 @@
"dev": true "dev": true
}, },
"cypress": { "cypress": {
"version": "6.4.0", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-6.4.0.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-6.5.0.tgz",
"integrity": "sha512-SrsPsZ4IBterudkoFYBvkQmXOVxclh1/+ytbzpV8AH/D2FA+s2Qy5ISsaRzOFsbQa4KZWoi3AKwREmF1HucYkg==", "integrity": "sha512-ol/yTAqHrQQpYBjxLlRSvZf4DOb9AhaQNVlwdOZgJcBHZOOa52/p/6/p3PPcvzjWGOMG6Yq0z4G+jrbWyk/9Dg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@cypress/listr-verbose-renderer": "^0.4.1", "@cypress/listr-verbose-renderer": "^0.4.1",
"@cypress/request": "^2.88.5", "@cypress/request": "^2.88.5",
"@cypress/xvfb": "^1.2.4", "@cypress/xvfb": "^1.2.4",
"@types/node": "12.12.50",
"@types/sinonjs__fake-timers": "^6.0.1", "@types/sinonjs__fake-timers": "^6.0.1",
"@types/sizzle": "^2.3.2", "@types/sizzle": "^2.3.2",
"arch": "^2.1.2", "arch": "^2.1.2",
@ -1527,7 +1528,7 @@
"commander": "^5.1.0", "commander": "^5.1.0",
"common-tags": "^1.8.0", "common-tags": "^1.8.0",
"dayjs": "^1.9.3", "dayjs": "^1.9.3",
"debug": "^4.1.1", "debug": "4.3.2",
"eventemitter2": "^6.4.2", "eventemitter2": "^6.4.2",
"execa": "^4.0.2", "execa": "^4.0.2",
"executable": "^4.1.1", "executable": "^4.1.1",
@ -1553,12 +1554,27 @@
"yauzl": "^2.10.0" "yauzl": "^2.10.0"
}, },
"dependencies": { "dependencies": {
"@types/node": {
"version": "12.12.50",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.50.tgz",
"integrity": "sha512-5ImO01Fb8YsEOYpV+aeyGYztcYcjGsBvN4D7G5r1ef2cuQOpymjWNQi5V0rKHE6PC2ru3HkoUr/Br2/8GUA84w==",
"dev": true
},
"commander": { "commander": {
"version": "5.1.0", "version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
"dev": true "dev": true
}, },
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"requires": {
"ms": "2.1.2"
}
},
"execa": { "execa": {
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz",
@ -1613,6 +1629,12 @@
"universalify": "^2.0.0" "universalify": "^2.0.0"
} }
}, },
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"universalify": { "universalify": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",

View file

@ -4,7 +4,7 @@
"description": "MatRepl is a Matrix * and a REPL. The Print part does operations on vectors and matrices in a visual environment.", "description": "MatRepl is a Matrix * and a REPL. The Print part does operations on vectors and matrices in a visual environment.",
"main": "src/js/index.js", "main": "src/js/index.js",
"scripts": { "scripts": {
"test": "jest --config=jest.config.js", "test": "cypress open",
"build": "webpack build", "build": "webpack build",
"watch": "webpack --watch", "watch": "webpack --watch",
"start": "webpack serve --open --host 0.0.0.0 --port 8080" "start": "webpack serve --open --host 0.0.0.0 --port 8080"
@ -21,7 +21,7 @@
"homepage": "https://github.com/shautvast/matrepl#readme", "homepage": "https://github.com/shautvast/matrepl#readme",
"devDependencies": { "devDependencies": {
"css-loader": "^5.0.2", "css-loader": "^5.0.2",
"cypress": "^6.4.0", "cypress": "^6.5.0",
"eslint": "^7.20.0", "eslint": "^7.20.0",
"eslint-loader": "^4.0.2", "eslint-loader": "^4.0.2",
"eslint-plugin-cypress": "^2.11.2", "eslint-plugin-cypress": "^2.11.2",

View file

@ -1,5 +1,3 @@
import './scanner.js';
import './parser.js';
import {update_lazy_objects} from "./console"; import {update_lazy_objects} from "./console";
/** /**