mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat(challenge29): add challenge 29 to the list
This commit is contained in:
@@ -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/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/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-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>
|
</br>
|
||||||
<img src="https://img.shields.io/badge/Nx--gray?logo=nx" alt="nx"/>
|
<img src="https://img.shields.io/badge/Nx--gray?logo=nx" alt="nx"/>
|
||||||
@@ -91,7 +92,7 @@ If you would like to propose a challenge, this project is open source, so feel f
|
|||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<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>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -4,19 +4,14 @@
|
|||||||
|
|
||||||
### Statement:
|
### 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.
|
This is a very simple application, but it will let you deal with asynchronous task and mocks
|
||||||
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`.
|
|
||||||
|
|
||||||
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.
|
You can also do it with cypress.
|
||||||
|
|
||||||
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. -->
|
|
||||||
|
|
||||||
### Submitting your work
|
### Submitting your work
|
||||||
|
|
||||||
@@ -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
|
6. `npx nx component-test testing-todos-list --watch` to test your application with Cypress
|
||||||
7. _...work on it_
|
7. _...work on it_
|
||||||
8. Commit your work
|
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%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%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%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> -->
|
<!-- <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> -->
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,29 @@
|
|||||||
describe('TicketStore', () => {
|
describe('TicketStore', () => {
|
||||||
describe('When adding a new Ticket', () => {
|
describe('When init', () => {
|
||||||
const NEW_TICKET = {
|
it('Then calls backend.users', async () => {
|
||||||
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('Given a failure answer from API', () => {
|
it('Then calls backend.tickets', async () => {
|
||||||
it('Then array of tickets still of lenght 1 and error is set', () => {});
|
//
|
||||||
|
});
|
||||||
|
|
||||||
|
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 () => {
|
||||||
|
//
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user