Skip to content

Commit

Permalink
message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariana-VV committed Jan 18, 2025
1 parent 1ee7010 commit 64945c8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<your_account>` with your GitHub username in the [DEMO LINK](https://<your_account>.github.io/react_todo-app/) and add it to the PR description.
- Replace `<your_account>` with your GitHub username in the [DEMO LINK](https://Mariana-VV.github.io/react_todo-app/) and add it to the PR description.
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 14 additions & 16 deletions cypress/integration/page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
});
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
});
Expand Down Expand Up @@ -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');
});
Expand Down Expand Up @@ -930,16 +930,14 @@ 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');
});
});
});

describe('on Escape', () => {


it('should be closed', () => {
todos.titleField(0).type('{esc}');

Expand Down Expand Up @@ -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');
});
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 64945c8

Please sign in to comment.