Skip to content

Commit

Permalink
Merge pull request #11 from wayungi/test-add-remove
Browse files Browse the repository at this point in the history
Test add remove
  • Loading branch information
Nyame-Wolf authored Jul 13, 2022
2 parents aa709ab + 7c53d7c commit c4a6211
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
aside.js
coverage/
.vscode/
methods.test.js
.vscode
22 changes: 0 additions & 22 deletions .vscode/settings.json

This file was deleted.

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ A web app designed to help web keep track of activities that are done and those

[Live Demo Link](https://wayungi.github.io/ToDoListApp/)

## Author
## Authors

👤 **Francis Wayungi**

- GitHub: [@githubhandle](https://github.com/wayungi)
- Twitter: [@twitterhandle](https://twitter.com/FrancisWayungi)
- LinkedIn: [LinkedIn](https://linkedin.com/in/francis-wayungi-3aa626231)

👤 **Mumenya Nyamu**
- GitHub: [@githubhandle](https://github.com/Nyame-Wolf/)
- Twitter: [@twitterhandle](https://twitter.com/Mumenyam)
- LinkedIn: [LinkedIn](https://www.linkedin.com/in/mumenya-nyamu-web-designer-data-enthusiast/)

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!
Expand Down
62 changes: 62 additions & 0 deletions src/tests/methods.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { removeTask, addTask, getTasks } from '../modules/methods.js';

describe('addtask', () => {
// Arrange
const task1 = {
description: 'Play soccer',
completed: false,
isbn: '1657742044934',
id: '1',
};

const task2 = {
description: 'Eat food',
completed: false,
isbn: '1657742044935',
id: '2',
};

const task3 = {
description: 'Take a nap',
completed: false,
isbn: '1657742044936',
id: '3',
};

test('Should add 1 task', () => {
// Act
addTask(task1);

// Assert
expect(getTasks().length).toEqual(1);
});

test('Should add 2 task', () => {
// Act
addTask(task2);
addTask(task3);

// Assert
expect(getTasks().length).toEqual(3);
});
});

describe('removeTask', () => {
// Arrange

test('Should remove 1 task', () => {
// Act
removeTask('1657742044934');

// Assert
expect(getTasks().length).toEqual(2);
});

test('Should remove 1 task', () => {
// Act
removeTask('1657742044936');

// Assert
expect(getTasks().length).toEqual(1);
});
});

0 comments on commit c4a6211

Please sign in to comment.