fix(test): move all test apps

This commit is contained in:
thomas
2023-10-18 10:35:53 +02:00
parent 058c7b04a0
commit 9a151be595
254 changed files with 273 additions and 273 deletions

View File

@@ -3,7 +3,7 @@ title: 🟠 Router
description: Challenge 17 is about testing the router
author: Thomas Laforge
challengeNumber: 17
command: test-router-outlet
command: testing-router-outlet
sidebar:
order: 108
---
@@ -12,9 +12,9 @@ sidebar:
We have a functional application that lists available books for borrowing inside a library. If the book you searched for is available, you will be directed to the corresponding book(s), otherwise, you will end up on an error page.
The file named `app.component.spec.ts` will let you test your application using Testing Library. To run the test suits, you need to run `npx nx test test-router-outlet`. 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.
The file named `app.component.spec.ts` will let you test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-router-outlet`. 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 `app.component.cy.ts` and run `npx nx component-test test-router-outlet` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
For testing cypress, you will execute your test inside the `app.component.cy.ts` and run `npx nx component-test testing-router-outlet` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement

View File

@@ -3,7 +3,7 @@ title: 🟠 Nested Components
description: Challenge 18 is about testing nested components
author: Thomas Laforge
challengeNumber: 18
command: test-nested
command: testing-nested
sidebar:
order: 109
---
@@ -14,11 +14,11 @@ We have a small application that sends a title, typed into an input to a fake ba
If the title is correctly typed, you can send the request otherwise you receive an error and the request is not sent.
The application is created with <b>nested components</b>. `ChildComponent` is the container that includes four components: `ResultComponent`, `ButtonComponent`, `InputComponent` and `ErrorComponent`. However since we are testing our component as a black box, the architecture of our components doesn't change anything. You can create your test, change how the components are structured, and your tests should still pass. That's the goal of integration tests. <b>Never test internal implementation details!!!</b>.
You can play with it by running : `npx nx serve test-nested`.
You can play with it by running : `npx nx serve testing-nested`.
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 test-nested`. 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.
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-nested`. 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 test-nested` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
For testing cypress, you will execute your test inside the `child.component.cy.ts` and run `npx nx component-test testing-nested` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement

View File

@@ -3,7 +3,7 @@ title: 🟠 Input Output
description: Challenge 19 is about testing inputs and ouputs
author: Thomas Laforge
challengeNumber: 19
command: test-input-output
command: testing-input-output
sidebar:
order: 110
---
@@ -12,11 +12,11 @@ sidebar:
We have a small counter application that increments or decrements a number. The `CounterComponent` takes an initial value as an `@Input` and emits the result of the counter as an `@Output` when we click on the **Send** button. Since we are testing our component as a black box, we only have access to our inputs and listen to the output values. <b>We should not rely on any internal implementation details!!!</b>
You can play with it by running : `npx nx serve test-input-output`.
You can play with it by running : `npx nx serve testing-input-output`.
The file named `counter.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test test-input-output`. 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.
The file named `counter.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-input-output`. 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 test-input-output` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
For testing cypress, you will execute your test inside the `child.component.cy.ts` and run `npx nx component-test testing-input-output` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement

View File

@@ -3,7 +3,7 @@ title: 🟠 Modal
description: Challenge 20 is about testing modals
author: Thomas Laforge
challengeNumber: 20
command: test-modal
command: testing-modal
sidebar:
order: 111
---
@@ -16,11 +16,11 @@ In the confirmation modal, if you click the **Confirm** button, a message confir
The goal of this challenge is to test the dialogs inside your application. To do so, we will test the full application like an end-to-end test will do. This means, we will test the `AppComponent` as a black box and react to events on the page. <b>No internal details should be tested</b>. The difference between an e2e test and integration test is that we will mock all API calls. _(All http requests are faked inside this application, but this would not be the case in a real entreprice application.)_
You can play with it by running : `npx nx serve test-modal`.
You can play with it by running : `npx nx serve testing-modal`.
The file named `app.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test test-modal`. 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.
The file named `app.component.spec.ts` will let test your application using Testing Library. To run the test suits, you need to run `npx nx test testing-modal`. 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 `app.component.cy.ts` and run `npx nx component-test test-modal` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
For testing cypress, you will execute your test inside the `app.component.cy.ts` and run `npx nx component-test testing-modal` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
# Statement

View File

@@ -3,7 +3,7 @@ title: 🟢 Harness
description: Challenge 23 is about testing with component harnesses
author: Thomas Laforge
challengeNumber: 23
command: test-harness
command: testing-harness
sidebar:
order: 9
---

View File

@@ -3,7 +3,7 @@ title: 🟠 Harness Creation
description: Challenge 24 is about creating a component harness.
author: Thomas Laforge
challengeNumber: 24
command: test-create-harness
command: testing-create-harness
sidebar:
order: 112
---

View File

@@ -3,7 +3,7 @@ title: 🟢 Checkbox
description: Challenge 28 is about testing a simple checkbox
author: Thomas Laforge
challengeNumber: 28
command: test-checkbox
command: testing-checkbox
sidebar:
order: 10
---

View File

@@ -3,7 +3,7 @@ title: 🔴 Real-life Application
description: Challenge 29 is about testing a real-life application
author: Thomas Laforge
challengeNumber: 29
command: test-todos-list
command: testing-todos-list
sidebar:
order: 205
---
@@ -18,11 +18,11 @@ In this challenge, you will write tests for the `ListComponent`, which represent
Handling asynchronous tasks will be particularly challenging. It's important not to introduce any explicit <b>waits</b> in your tests, as this would introduce unnecessary delays. Instead, it's better to look for an element that needs to appear or disappear from the DOM. In this case, the test will naturally wait for the correct period of time, as the waits are already implemented within both libraries. Take advantage of these built-in functionalities to create efficient and reliable tests.
You can play with it by running : `npx nx serve test-todos-list`.
You can play with it by running : `npx nx serve testing-todos-list`.
To run Testing Library test suits, you need to run `npx nx test test-input-output`. 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.
To run Testing Library 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 test-input-output` to execute your test suits. You can add the `--watch` flag to execute your test in watch mode.
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.
# Statement