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: d59e4f2
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: 31ad7ce
Choose a head ref
  • 7 commits
  • 73 files changed
  • 3 contributors

Commits on Dec 21, 2024

  1. docs: add Angular 19 to Version compatibility table (#509)

    timdeschryver authored Dec 21, 2024
    Copy the full SHA
    5ef0863 View commit details

Commits on Jan 3, 2025

  1. chore: update deps (#510)

    timdeschryver authored Jan 3, 2025
    Copy the full SHA
    33af287 View commit details

Commits on Jan 4, 2025

  1. chore: migrate to eslint flat config

    timdeschryver authored Jan 4, 2025
    Copy the full SHA
    e0cd81e View commit details

Commits on Jan 13, 2025

  1. fix: do not force npm to install dependencies when using ng add (#515)

    Closes #513
    FabienDehopre authored Jan 13, 2025
    Copy the full SHA
    a18f647 View commit details
  2. docs: add host directive example (#514)

    Closes #512
    timdeschryver authored Jan 13, 2025
    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. chore: fix devcontainer creation (#518)

    timdeschryver authored Feb 14, 2025
    Copy the full SHA
    31ad7ce View commit details
Showing with 298 additions and 419 deletions.
  1. +9 −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. +3 −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. +0 −2 projects/testing-library/schematics/migrations/dtl-as-dev-dependency/index.spec.ts
  60. +2 −2 projects/testing-library/schematics/ng-add/index.ts
  61. +0 −1 projects/testing-library/schematics/ng-add/schema.ts
  62. +2 −2 projects/testing-library/src/lib/models.ts
  63. +1 −1 projects/testing-library/src/lib/testing-library.ts
  64. +0 −1 projects/testing-library/test-setup.ts
  65. +4 −4 projects/testing-library/tests/debug.spec.ts
  66. +2 −2 projects/testing-library/tests/issues/issue-280.spec.ts
  67. +0 −1 projects/testing-library/tests/issues/issue-389.spec.ts
  68. +0 −1 projects/testing-library/tests/issues/issue-396-standalone-stub-child.spec.ts
  69. +0 −2 projects/testing-library/tests/issues/issue-398-component-without-host-id.spec.ts
  70. +1 −0 projects/testing-library/tests/issues/issue-422-view-already-destroyed.spec.ts
  71. +0 −2 projects/testing-library/tests/issues/issue-437.spec.ts
  72. +1 −1 projects/testing-library/tests/issues/issue-493.spec.ts
  73. +9 −10 projects/testing-library/tests/render.spec.ts
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -419,6 +419,15 @@
"contributions": [
"code"
]
},
{
"login": "FabienDehopre",
"name": "Fabien Dehopré",
"avatar_url": "https://avatars.githubusercontent.com/u/97023?v=4",
"profile": "https://github.com/FabienDehopre",
"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
4 changes: 3 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,7 @@ 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>
</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