mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
feat(doc): move forms
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": ["../../.eslintrc.json"],
|
"extends": ["../../../.eslintrc.json"],
|
||||||
"ignorePatterns": ["!**/*"],
|
"ignorePatterns": ["!**/*"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@@ -8,13 +8,13 @@ NOT IMPLEMENTED YET
|
|||||||
|
|
||||||
<!-- We have a small application that send a title to a fake backend that you type inside a input.
|
<!-- 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.
|
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-forms`.
|
You can play with it by running : `npx nx serve test-forms`.
|
||||||
|
|
||||||
The goal is to test this behavior with Testing library and Cypress
|
The goal is to test this behavior with Testing library and Cypress
|
||||||
|
|
||||||
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-forms`. 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-forms`. 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-forms` 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-forms` 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. -->
|
I created some `it` blocks but feel free to add more test if you like to. -->
|
||||||
|
|
||||||
@@ -23,9 +23,9 @@ I created some `it` blocks but feel free to add more test if you like to. -->
|
|||||||
1. Fork the project
|
1. Fork the project
|
||||||
2. clone it
|
2. clone it
|
||||||
3. npm ci
|
3. npm ci
|
||||||
4. `npx nx serve testing-forms` to play with the application
|
4. `npx nx serve test-forms` to play with the application
|
||||||
5. `npx nx test testing-forms` to test your application with Testing Library
|
5. `npx nx test test-forms` to test your application with Testing Library
|
||||||
6. `npx nx component-test testing-forms --watch` to test your application with Cypress
|
6. `npx nx component-test test-forms --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:20** that I will review and other dev can review.
|
9. Submit a PR with a title beginning with **Answer:20** that I will review and other dev can review.
|
||||||
12
apps/test/forms/cypress/support/component-index.html
Normal file
12
apps/test/forms/cypress/support/component-index.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||||
|
<title>testing-forms Components App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div data-cy-root></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export default {
|
export default {
|
||||||
displayName: 'testing-forms',
|
displayName: 'test-forms',
|
||||||
preset: '../../jest.preset.js',
|
preset: '../../../jest.preset.js',
|
||||||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(ts|mjs|js|html)$': [
|
'^.+\\.(ts|mjs|js|html)$': [
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "testing-forms",
|
"name": "test-forms",
|
||||||
"$schema": "../node_modules/nx/schemas/project-schema.json",
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||||
"projectType": "application",
|
"projectType": "application",
|
||||||
"sourceRoot": "apps/testing-forms/src",
|
"sourceRoot": "apps/test/forms/src",
|
||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"targets": {
|
"targets": {
|
||||||
"build": {
|
"build": {
|
||||||
"executor": "@angular-devkit/build-angular:browser",
|
"executor": "@angular-devkit/build-angular:browser",
|
||||||
"outputs": ["{options.outputPath}"],
|
"outputs": ["{options.outputPath}"],
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/apps/testing-forms",
|
"outputPath": "dist/apps/test/forms",
|
||||||
"index": "apps/testing-forms/src/index.html",
|
"index": "apps/test/forms/src/index.html",
|
||||||
"main": "apps/testing-forms/src/main.ts",
|
"main": "apps/test/forms/src/main.ts",
|
||||||
"polyfills": ["zone.js"],
|
"polyfills": ["zone.js"],
|
||||||
"tsConfig": "apps/testing-forms/tsconfig.app.json",
|
"tsConfig": "apps/test/forms/tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
"assets": [
|
"assets": [
|
||||||
"apps/testing-forms/src/favicon.ico",
|
"apps/test/forms/src/favicon.ico",
|
||||||
"apps/testing-forms/src/assets"
|
"apps/test/forms/src/assets"
|
||||||
],
|
],
|
||||||
"styles": ["apps/testing-forms/src/styles.scss"],
|
"styles": ["apps/test/forms/src/styles.scss"],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -53,10 +53,10 @@
|
|||||||
"executor": "@angular-devkit/build-angular:dev-server",
|
"executor": "@angular-devkit/build-angular:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "testing-forms:build:production"
|
"browserTarget": "test-forms:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"browserTarget": "testing-forms:build:development"
|
"browserTarget": "test-forms:build:development"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"executor": "@angular-devkit/build-angular:extract-i18n",
|
"executor": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "testing-forms:build"
|
"browserTarget": "test-forms:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
"outputs": ["{options.outputFile}"],
|
"outputs": ["{options.outputFile}"],
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": [
|
||||||
"apps/testing-forms/**/*.ts",
|
"apps/test/forms/**/*.ts",
|
||||||
"apps/testing-forms/**/*.html"
|
"apps/test/forms/**/*.html"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
"executor": "@nx/jest:jest",
|
"executor": "@nx/jest:jest",
|
||||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
"options": {
|
"options": {
|
||||||
"jestConfig": "apps/testing-forms/jest.config.ts",
|
"jestConfig": "apps/test/forms/jest.config.ts",
|
||||||
"passWithNoTests": true
|
"passWithNoTests": true
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
@@ -94,10 +94,10 @@
|
|||||||
"component-test": {
|
"component-test": {
|
||||||
"executor": "@nx/cypress:cypress",
|
"executor": "@nx/cypress:cypress",
|
||||||
"options": {
|
"options": {
|
||||||
"cypressConfig": "apps/testing-forms/cypress.config.ts",
|
"cypressConfig": "apps/test/forms/cypress.config.ts",
|
||||||
"testingType": "component",
|
"testingType": "component",
|
||||||
"skipServe": true,
|
"skipServe": true,
|
||||||
"devServerTarget": "testing-forms:build"
|
"devServerTarget": "test-forms:build"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../../dist/out-tsc",
|
||||||
"types": []
|
"types": []
|
||||||
},
|
},
|
||||||
"files": ["src/main.ts"],
|
"files": ["src/main.ts"],
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"path": "./cypress/tsconfig.json"
|
"path": "./cypress/tsconfig.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../../tsconfig.base.json",
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"enableI18nLegacyMessageIdFormat": false,
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../../dist/out-tsc",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"types": ["jest", "node", "@testing-library/jest-dom"]
|
"types": ["jest", "node", "@testing-library/jest-dom"]
|
||||||
},
|
},
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<title>testing-forms Components App</title>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div data-cy-root></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user