Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: testing-library/angular-testing-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v17.3.4
Choose a base ref
...
head repository: testing-library/angular-testing-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 10 commits
  • 75 files changed
  • 5 contributors

Commits on Dec 14, 2024

  1. Copy the full SHA
    d59e4f2 View commit details

Commits on Dec 21, 2024

  1. Copy the full SHA
    5ef0863 View commit details

Commits on Jan 3, 2025

  1. Copy the full SHA
    33af287 View commit details

Commits on Jan 4, 2025

  1. Copy the full SHA
    e0cd81e View commit details

Commits on Jan 13, 2025

  1. Copy the full SHA
    a18f647 View commit details
  2. Copy the full SHA
    6efeb36 View commit details
  3. docs: add FabienDehopre as a contributor for code (#516)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Jan 13, 2025
    Copy the full SHA
    90c43c7 View commit details

Commits on Feb 14, 2025

  1. Copy the full SHA
    31ad7ce View commit details

Commits on Mar 31, 2025

  1. Copy the full SHA
    3176b33 View commit details
  2. Copy the full SHA
    e1e046c View commit details
Showing with 330 additions and 421 deletions.
  1. +18 −0 .all-contributorsrc
  2. +2 −2 .devcontainer/devcontainer.json
  3. +0 −1 .eslintignore
  4. +0 −127 .eslintrc.json
  5. +3 −1 .github/workflows/ci.yml
  6. +1 −1 .node-version
  7. +4 −1 README.md
  8. +0 −44 apps/example-app-karma/.eslintrc.json
  9. +7 −0 apps/example-app-karma/eslint.config.cjs
  10. +8 −0 apps/example-app-karma/eslint.config.mjs
  11. +0 −1 apps/example-app-karma/jasmine-dom.d.ts
  12. +2 −2 apps/example-app-karma/src/app/examples/login-form.spec.ts
  13. +2 −2 apps/example-app-karma/src/app/issues/rerender.spec.ts
  14. +0 −47 apps/example-app/.eslintrc.json
  15. +7 −0 apps/example-app/eslint.config.cjs
  16. +8 −0 apps/example-app/eslint.config.mjs
  17. +0 −1 apps/example-app/jest.config.ts
  18. +1 −1 apps/example-app/src/app/examples/00-single-component.ts
  19. +6 −6 apps/example-app/src/app/examples/01-nested-component.ts
  20. +2 −2 apps/example-app/src/app/examples/02-input-output.spec.ts
  21. +1 −1 apps/example-app/src/app/examples/02-input-output.ts
  22. +1 −1 apps/example-app/src/app/examples/03-forms.ts
  23. +1 −1 apps/example-app/src/app/examples/04-forms-with-material.ts
  24. +1 −1 apps/example-app/src/app/examples/05-component-provider.ts
  25. +1 −1 apps/example-app/src/app/examples/06-with-ngrx-store.ts
  26. +4 −2 apps/example-app/src/app/examples/07-with-ngrx-mock-store.ts
  27. +4 −4 apps/example-app/src/app/examples/08-directive.spec.ts
  28. +1 −1 apps/example-app/src/app/examples/08-directive.ts
  29. +3 −3 apps/example-app/src/app/examples/09-router.ts
  30. +1 −1 apps/example-app/src/app/examples/10-inject-token-dependency.ts
  31. +1 −1 apps/example-app/src/app/examples/11-ng-content.spec.ts
  32. +1 −1 apps/example-app/src/app/examples/11-ng-content.ts
  33. +1 −1 apps/example-app/src/app/examples/12-service-component.ts
  34. +1 −1 apps/example-app/src/app/examples/13-scrolling.component.ts
  35. +0 −1 apps/example-app/src/app/examples/14-async-component.spec.ts
  36. +1 −1 apps/example-app/src/app/examples/14-async-component.ts
  37. +1 −1 apps/example-app/src/app/examples/15-dialog.component.spec.ts
  38. +2 −2 apps/example-app/src/app/examples/15-dialog.component.ts
  39. +1 −1 apps/example-app/src/app/examples/16-input-getter-setter.ts
  40. +1 −1 apps/example-app/src/app/examples/17-component-with-attribute-selector.spec.ts
  41. +1 −1 apps/example-app/src/app/examples/17-component-with-attribute-selector.ts
  42. +3 −3 apps/example-app/src/app/examples/19-standalone-component.ts
  43. +1 −3 apps/example-app/src/app/examples/20-test-harness.spec.ts
  44. +1 −1 apps/example-app/src/app/examples/20-test-harness.ts
  45. +2 −2 apps/example-app/src/app/examples/21-deferable-view.component.ts
  46. +1 −1 apps/example-app/src/app/examples/22-signal-inputs.component.spec.ts
  47. +3 −3 apps/example-app/src/app/examples/22-signal-inputs.component.ts
  48. +22 −0 apps/example-app/src/app/examples/23-host-directive.spec.ts
  49. +21 −0 apps/example-app/src/app/examples/23-host-directive.ts
  50. +3 −1 apps/example-app/src/test-setup.ts
  51. +7 −0 eslint.config.cjs
  52. +66 −0 eslint.config.mjs
  53. +2 −2 nx.json
  54. +39 −41 package.json
  55. +0 −62 projects/testing-library/.eslintrc.json
  56. +7 −0 projects/testing-library/eslint.config.cjs
  57. +8 −0 projects/testing-library/eslint.config.mjs
  58. +0 −1 projects/testing-library/jest.config.ts
  59. +1 −0 projects/testing-library/package.json
  60. +0 −2 projects/testing-library/schematics/migrations/dtl-as-dev-dependency/index.spec.ts
  61. +2 −2 projects/testing-library/schematics/ng-add/index.ts
  62. +0 −1 projects/testing-library/schematics/ng-add/schema.ts
  63. +2 −2 projects/testing-library/src/lib/models.ts
  64. +3 −2 projects/testing-library/src/lib/testing-library.ts
  65. +0 −1 projects/testing-library/test-setup.ts
  66. +4 −4 projects/testing-library/tests/debug.spec.ts
  67. +2 −2 projects/testing-library/tests/issues/issue-280.spec.ts
  68. +0 −1 projects/testing-library/tests/issues/issue-389.spec.ts
  69. +0 −1 projects/testing-library/tests/issues/issue-396-standalone-stub-child.spec.ts
  70. +0 −2 projects/testing-library/tests/issues/issue-398-component-without-host-id.spec.ts
  71. +1 −0 projects/testing-library/tests/issues/issue-422-view-already-destroyed.spec.ts
  72. +0 −2 projects/testing-library/tests/issues/issue-437.spec.ts
  73. +1 −1 projects/testing-library/tests/issues/issue-493.spec.ts
  74. +19 −1 projects/testing-library/tests/providers/component-provider.spec.ts
  75. +9 −10 projects/testing-library/tests/render.spec.ts
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -419,6 +419,24 @@
"contributions": [
"code"
]
},
{
"login": "FabienDehopre",
"name": "Fabien Dehopré",
"avatar_url": "https://avatars.githubusercontent.com/u/97023?v=4",
"profile": "https://github.com/FabienDehopre",
"contributions": [
"code"
]
},
{
"login": "jvereecken",
"name": "Jamie Vereecken",
"avatar_url": "https://avatars.githubusercontent.com/u/108937550?v=4",
"profile": "https://github.com/jvereecken",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "angular-testing-library",
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-20-bullseye",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
@@ -13,7 +13,7 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm i",
"postCreateCommand": "npm install --force",
"onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt",
"waitFor": "postCreateCommand",

1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

127 changes: 0 additions & 127 deletions .eslintrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
node-version: ${{ fromJSON((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && '[20]' || '[18, 20]') }}
node-version: ${{ fromJSON((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && '[22]' || '[18, 20, 22]') }}
os: ${{ fromJSON((github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest"]') }}
runs-on: ${{ matrix.os }}

@@ -38,6 +38,8 @@ jobs:
run: npm run build -- --skip-nx-cache
- name: test
run: npm run test
- name: lint
run: npm run lint
- name: Release
if: github.repository == 'testing-library/angular-testing-library' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
run: npx semantic-release
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.9
22
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ counter.component.ts

```ts
@Component({
selector: 'app-counter',
selector: 'atl-counter',
template: `
<span>{{ hello() }}</span>
<button (click)="decrement()">-</button>
@@ -179,6 +179,7 @@ You may also be interested in installing `jest-dom` so you can use

| Angular | Angular Testing Library |
| ------- | ---------------------------- |
| 19.x | 17.x, 16.x, 15.x, 14.x, 13.x |
| 18.x | 17.x, 16.x, 15.x, 14.x, 13.x |
| 17.x | 17.x, 16.x, 15.x, 14.x, 13.x |
| 16.x | 14.x, 13.x |
@@ -272,6 +273,8 @@ Thanks goes to these people ([emoji key][emojis]):
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://arthurpetrie.com"><img src="https://avatars.githubusercontent.com/u/16376476?v=4?s=100" width="100px;" alt="Arthur Petrie"/><br /><sub><b>Arthur Petrie</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=Arthie" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/FabienDehopre"><img src="https://avatars.githubusercontent.com/u/97023?v=4?s=100" width="100px;" alt="Fabien Dehopré"/><br /><sub><b>Fabien Dehopré</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=FabienDehopre" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jvereecken"><img src="https://avatars.githubusercontent.com/u/108937550?v=4?s=100" width="100px;" alt="Jamie Vereecken"/><br /><sub><b>Jamie Vereecken</b></sub></a><br /><a href="https://github.com/testing-library/angular-testing-library/commits?author=jvereecken" title="Code">💻</a></td>
</tr>
</tbody>
</table>
44 changes: 0 additions & 44 deletions apps/example-app-karma/.eslintrc.json

This file was deleted.

7 changes: 7 additions & 0 deletions apps/example-app-karma/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @ts-check

// TODO - https://github.com/nrwl/nx/issues/22576

/** @type {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigPromise} */
const config = (async () => (await import('./eslint.config.mjs')).default)();
module.exports = config;
8 changes: 8 additions & 0 deletions apps/example-app-karma/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check

import tseslint from "typescript-eslint";
import rootConfig from "../../eslint.config.mjs";

export default tseslint.config(
...rootConfig,
);
1 change: 0 additions & 1 deletion apps/example-app-karma/jasmine-dom.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
declare module '@testing-library/jasmine-dom' {
// eslint-disable-next-line @typescript-eslint/naming-convention
const JasmineDOM: any;
export default JasmineDOM;
}
4 changes: 2 additions & 2 deletions apps/example-app-karma/src/app/examples/login-form.spec.ts
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ it('should display invalid message and submit button must be disabled', async ()
});

@Component({
selector: 'app-login',
selector: 'atl-login',
standalone: true,
imports: [ReactiveFormsModule, NgIf],
template: `
@@ -51,7 +51,7 @@ class LoginComponent {
});

constructor(private fb: FormBuilder) {}

get email(): FormControl {
return this.form.get('email') as FormControl;
}
4 changes: 2 additions & 2 deletions apps/example-app-karma/src/app/issues/rerender.spec.ts
Original file line number Diff line number Diff line change
@@ -7,9 +7,9 @@ it('can rerender component', async () => {
},
});

expect(screen.getByText('Hello Sarah')).toBeTruthy();
expect(screen.getByText('Hello Sarah')).toBeInTheDocument();

await rerender({ componentProperties: { name: 'Mark' } });

expect(screen.getByText('Hello Mark')).toBeTruthy();
expect(screen.getByText('Hello Mark')).toBeInTheDocument();
});
47 changes: 0 additions & 47 deletions apps/example-app/.eslintrc.json

This file was deleted.

7 changes: 7 additions & 0 deletions apps/example-app/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @ts-check

// TODO - https://github.com/nrwl/nx/issues/22576

/** @type {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigPromise} */
const config = (async () => (await import('./eslint.config.mjs')).default)();
module.exports = config;
8 changes: 8 additions & 0 deletions apps/example-app/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check

import tseslint from "typescript-eslint";
import rootConfig from "../../eslint.config.mjs";

export default tseslint.config(
...rootConfig,
);
1 change: 0 additions & 1 deletion apps/example-app/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
export default {
displayName: {
name: 'Example App',
2 changes: 1 addition & 1 deletion apps/example-app/src/app/examples/00-single-component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-fixture',
selector: 'atl-fixture',
standalone: true,
template: `
<button (click)="value = value - 1">Decrement</button>
Loading