diff --git a/README.md b/README.md index 903c876f9..1b44df94c 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,4 @@ Implement a simple [TODO app](https://mate-academy.github.io/react_todo-app/) th - Implement a solution following the [React task guidelines](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Use the [React TypeScript cheat sheet](https://mate-academy.github.io/fe-program/js/extra/react-typescript). - Open another terminal and run tests with `npm test` to ensure your solution is correct. -- Replace `` with your GitHub username in the [DEMO LINK](https://.github.io/react_todo-app/) and add it to the PR description. +- Replace `` with your GitHub username in the [DEMO LINK](https://Mariana-VV.github.io/react_todo-app/) and add it to the PR description. diff --git a/cypress.config.ts b/cypress.config.ts index 6aa317d01..34bee65f6 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,7 +2,7 @@ const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { - baseUrl: 'http://localhost:3000', + baseUrl: 'http://localhost:5173', specPattern: 'cypress/integration/**/*.spec.{js,ts,jsx,tsx}', }, video: true, diff --git a/cypress/integration/page.spec.js b/cypress/integration/page.spec.js index 0875764e1..57ce99b8e 100644 --- a/cypress/integration/page.spec.js +++ b/cypress/integration/page.spec.js @@ -10,7 +10,7 @@ const page = { localStorage: () => cy.getAllLocalStorage().its('http://localhost:3001'), data: () => page.localStorage().then(({ todos = '[]' }) => JSON.parse(todos)), - visit: (initialTodos) => { + visit: initialTodos => { cy.visit('/', { onBeforeLoad: win => { if (initialTodos) { @@ -138,7 +138,7 @@ describe('', () => { it('should save todos to localStorage in JSON', () => { page.localStorage().should('have.keys', 'todos'); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.be.instanceOf(Array); expect(todos).to.have.length(1); expect(todos[0].title).to.equal('First todo'); @@ -365,7 +365,7 @@ describe('', () => { it('should save updated todos to localStorage', () => { page.newTodoField().type('Test Todo{enter}'); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(6); expect(todos[5].title).to.equal('Test Todo'); expect(todos[5].completed).to.be.false; @@ -404,7 +404,7 @@ describe('', () => { page.newTodoField().type('Test Todo{enter}'); page.newTodoField().type('Hello world{enter}'); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(7); expect(todos[6].title).to.equal('Hello world'); expect(todos[6].completed).to.be.false; @@ -441,7 +441,7 @@ describe('', () => { it('should save all changes to localStorage', () => { todos.deleteButton(0).click(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(4); expect(todos[0].title).to.equal('CSS'); }); @@ -528,7 +528,7 @@ describe('', () => { it('should save all changes to localStorage', () => { page.clearCompletedButton().click(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(2); expect(todos[0].title).to.equal('TypeScript'); expect(todos[0].completed).to.be.false; @@ -588,7 +588,7 @@ describe('', () => { }); it('should save changes to localStorage', () => { - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].title).to.equal('HTML'); expect(todos[0].completed).to.be.false; @@ -655,7 +655,7 @@ describe('', () => { it('should save changes to localStorage', () => { page.toggleAllButton().click(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].completed).to.be.false; expect(todos[1].completed).to.be.false; @@ -700,7 +700,7 @@ describe('', () => { it('should save changes to localStorage', () => { page.toggleAllButton().click(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].completed).to.be.true; expect(todos[1].completed).to.be.true; @@ -746,7 +746,7 @@ describe('', () => { it('should save changes to localStorage', () => { page.toggleAllButton().click(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].completed).to.be.true; expect(todos[1].completed).to.be.true; @@ -830,7 +830,7 @@ describe('', () => { it('should save changes to localStorage', () => { todos.titleField(0).type(' Some new title {enter}'); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].title).to.equal('Some new title'); }); @@ -871,7 +871,7 @@ describe('', () => { todos.titleField(0).type(' Some new title '); todos.titleField(0).blur(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(5); expect(todos[0].title).to.equal('Some new title'); }); @@ -930,7 +930,7 @@ describe('', () => { it('should save changes to localStorage', () => { todos.titleField(0).type('{enter}'); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(4); expect(todos[0].title).to.equal('CSS'); }); @@ -938,8 +938,6 @@ describe('', () => { }); describe('on Escape', () => { - - it('should be closed', () => { todos.titleField(0).type('{esc}'); @@ -970,7 +968,7 @@ describe('', () => { it('should save changes to localStorage', () => { todos.titleField(0).blur(); - page.data().then((todos) => { + page.data().then(todos => { expect(todos).to.have.length(4); expect(todos[0].title).to.equal('CSS'); }); diff --git a/package-lock.json b/package-lock.json index 0adcc869f..1f19b4743 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.8.5", + "@mate-academy/scripts": "^1.9.12", "@mate-academy/students-ts-config": "*", "@mate-academy/stylelint-config": "*", "@types/node": "^20.14.10", @@ -1170,9 +1170,9 @@ } }, "node_modules/@mate-academy/scripts": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.5.tgz", - "integrity": "sha512-mHRY2FkuoYCf5U0ahIukkaRo5LSZsxrTSgMJheFoyf3VXsTvfM9OfWcZIDIDB521kdPrScHHnRp+JRNjCfUO5A==", + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz", + "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==", "dev": true, "dependencies": { "@octokit/rest": "^17.11.2", diff --git a/package.json b/package.json index e6134ce84..91d7489b9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@cypress/react18": "^2.0.1", - "@mate-academy/scripts": "^1.8.5", + "@mate-academy/scripts": "^1.9.12", "@mate-academy/students-ts-config": "*", "@mate-academy/stylelint-config": "*", "@types/node": "^20.14.10",