feat(doc): move nested

This commit is contained in:
thomas
2023-10-17 23:12:53 +02:00
parent be270efde1
commit a855cb0a8a
27 changed files with 41 additions and 42 deletions

View File

@@ -3,7 +3,7 @@ title: 🟠 Nested Components
description: Challenge 18 is about testing nested components
author: Thomas Laforge
challengeNumber: 18
command: testing-nested
command: test-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 testing-nested`.
You can play with it by running : `npx nx serve test-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 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.
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.
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.
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.
# Statement