Skip to content

Commit

Permalink
feat(challenge29): add challenge 29 to the list
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasL committed Jul 5, 2023
1 parent 22430f9 commit 5ca1268
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ If you would like to propose a challenge, this project is open source, so feel f
<a href="./apps/testing-harness/README.md"><img src="https://img.shields.io/badge/23-Harness Testing-green" alt="harness Testing"/></a>
<a href="./apps/create-harness/README.md"><img src="https://img.shields.io/badge/24-Create Harness-orange" alt="Create harness"/></a>
<a href="./apps/testing-checkbox/README.md"><img src="https://img.shields.io/badge/28-Checkbox Testing-green" alt="Test a simple checkbox"/></a>
<a href="./apps/testing-todos-list/README.md"><img src="https://img.shields.io/badge/29-Real application Testing-red" alt="Test a real application"/></a>

</br>
<img src="https://img.shields.io/badge/Nx--gray?logo=nx" alt="nx"/>
Expand All @@ -91,7 +92,7 @@ If you would like to propose a challenge, this project is open source, so feel f
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@thomas.laforge"><img src="https://avatars.githubusercontent.com/u/30832608?s…00&u=6f0ad9676792f29fd7fe6e113df06213d384a813&v=4" width="100px;" alt="Thomas Laforge"/><br /><sub><b>Thomas Laforge</b></sub></a><br />28 🧩</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@thomas.laforge"><img src="https://avatars.githubusercontent.com/u/30832608?s…00&u=6f0ad9676792f29fd7fe6e113df06213d384a813&v=4" width="100px;" alt="Thomas Laforge"/><br /><sub><b>Thomas Laforge</b></sub></a><br />29 🧩</a></td>
</tr>
</tbody>
</table>
Expand Down
21 changes: 8 additions & 13 deletions apps/testing-todos-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@
### Statement:

NOT IMPLEMENTED YET
I built this more real life application to create more real life test cases.
In this application, you can search for tickets, you can assign or finish them. You can also create new tickets.

<!-- We have a small application that send a title to a fake backend that you type inside a input.
If the title is correctly typed, you can send the request otherwise you get a nice error and the request is not sent.
You can play with it by running : `npx nx serve testing-todos-list`.
This is a very simple application, but it will let you deal with asynchronous task and mocks

The goal is to test this behavior with Testing library and Cypress
The goal of this challenge is to write all test cases of `ticket.store` , `list.component` and `row.component` with Testing Library.

The file named `child.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-todos-list`. You can also install [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) to execute your test by clicking on the `Run` button above each `describe` or `it` blocks.
For testing cypress, you will execute your test inside the `child.component.cy.ts` and run `npx nx component-test testing-todos-list` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
I created some `it` blocks but feel free to add more test if you like to. -->
You can also do it with cypress.

### Submitting your work

Expand All @@ -28,10 +23,10 @@ I created some `it` blocks but feel free to add more test if you like to. -->
6. `npx nx component-test testing-todos-list --watch` to test your application with Cypress
7. _...work on it_
8. Commit your work
9. Submit a PR with a title beginning with **Answer:23** that I will review and other dev can review.
9. Submit a PR with a title beginning with **Answer:28** that I will review and other dev can review.

<a href="https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A23+label%3Aanswer"><img src="https://img.shields.io/badge/-Solutions-green" alt="todo list app testing"/></a>
<a href='https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A23+label%3A"answer+author"'><img src="https://img.shields.io/badge/-Author solution-important" alt="todo list app testing solution author"/></a>
<a href="https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A28+label%3Aanswer"><img src="https://img.shields.io/badge/-Solutions-green" alt="todo list app testing"/></a>
<a href='https://github.com/tomalaforge/angular-challenges/pulls?q=label%3A285+label%3A"answer+author"'><img src="https://img.shields.io/badge/-Author solution-important" alt="todo list app testing solution author"/></a>

<!-- <a href="{Blog post url}" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/-Blog post explanation-blue" alt="nested testing blog article"/></a> -->

Expand Down
42 changes: 23 additions & 19 deletions apps/testing-todos-list/src/app/list/ticket.store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
describe('TicketStore', () => {
describe('When adding a new Ticket', () => {
const NEW_TICKET = {
id: 1,
description: 'test 2',
assigneeId: 888,
completed: false,
};
const tickets = [
{
id: 0,
description: 'test',
assigneeId: 888,
completed: false,
},
];
describe('Given a success answer from API', () => {
it('Then array of tickets is of lenght 2', () => {});
describe('When init', () => {
it('Then calls backend.users', async () => {
//
});

describe('Given a failure answer from API', () => {
it('Then array of tickets still of lenght 1 and error is set', () => {});
it('Then calls backend.tickets', async () => {
//
});

describe('Given all api returns success response', () => {
it('Then tickets and users should be merged ', async () => {
//
});
});

describe('Given users api returns failure response', () => {
it('Then tickets should not have any assignee', () => {
//
});
});

describe('When adding a new ticket with success', () => {
it('Then ticket is added to the list', async () => {
//
});
});
});
});

0 comments on commit 5ca1268

Please sign in to comment.