From 5ca1268b46ba8a8616f5d20d40ffcf705a3376b4 Mon Sep 17 00:00:00 2001 From: ThomasL Date: Wed, 5 Jul 2023 17:30:35 +0200 Subject: [PATCH] feat(challenge29): add challenge 29 to the list --- README.md | 3 +- apps/testing-todos-list/README.md | 21 ++++------ .../src/app/list/ticket.store.spec.ts | 42 ++++++++++--------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 207004a..2503690 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ If you would like to propose a challenge, this project is open source, so feel f harness Testing Create harness Test a simple checkbox +Test a real application
nx @@ -91,7 +92,7 @@ If you would like to propose a challenge, this project is open source, so feel f - +
Thomas Laforge
Thomas Laforge

28 🧩
Thomas Laforge
Thomas Laforge

29 🧩
diff --git a/apps/testing-todos-list/README.md b/apps/testing-todos-list/README.md index 4bffc68..4bd63f0 100644 --- a/apps/testing-todos-list/README.md +++ b/apps/testing-todos-list/README.md @@ -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. - +You can also do it with cypress. ### 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 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. -todo list app testing -todo list app testing solution author +todo list app testing +todo list app testing solution author diff --git a/apps/testing-todos-list/src/app/list/ticket.store.spec.ts b/apps/testing-todos-list/src/app/list/ticket.store.spec.ts index 426b0e1..7155bb0 100644 --- a/apps/testing-todos-list/src/app/list/ticket.store.spec.ts +++ b/apps/testing-todos-list/src/app/list/ticket.store.spec.ts @@ -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 () => { + // + }); }); }); });