diff --git a/.all-contributorsrc b/.all-contributorsrc
index d32934f4..291aa0ce 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -168,6 +168,16 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "jbchr",
+ "name": "Janek",
+ "avatar_url": "https://avatars1.githubusercontent.com/u/23141806?v=4",
+ "profile": "https://github.com/jbchr",
+ "contributions": [
+ "code",
+ "test"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/README.md b/README.md
index 64dac4f5..79538b8b 100644
--- a/README.md
+++ b/README.md
@@ -185,32 +185,34 @@ Thanks goes to these people ([emoji key][emojis]):
-
+
+
This project follows the [all-contributors][all-contributors] specification.
@@ -224,6 +226,7 @@ Contributions of any kind welcome!
## FAQ
##### I am using Reactive Forms and the `jest-dom` matcher `toHaveFormValues` always returns an empty object or there are missing fields. Why?
+
Only form elements with a `name` attribute will have their values passed to `toHaveFormsValues`.
## Issues
@@ -273,7 +276,7 @@ Links:
[downloads-badge]: https://img.shields.io/npm/dm/@testing-library/angular.svg?style=flat-square
[npmtrends]: http://www.npmtrends.com/@testing-library/angular
[discord-badge]: https://img.shields.io/discord/723559267868737556.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
-[discord]: https://discord.gg/c6JN9fM
+[discord]: https://discord.gg/testing-library
[license-badge]: https://img.shields.io/npm/l/@testing-library/angular.svg?style=flat-square
[license]: https://github.com/testing-library/angular-testing-library/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
diff --git a/projects/testing-library/src/lib/testing-library.ts b/projects/testing-library/src/lib/testing-library.ts
index 66631dc8..77e275ef 100644
--- a/projects/testing-library/src/lib/testing-library.ts
+++ b/projects/testing-library/src/lib/testing-library.ts
@@ -26,6 +26,7 @@ import { RenderComponentOptions, RenderDirectiveOptions, RenderResult } from './
import { getConfig } from './config';
const mountedFixtures = new Set>();
+const inject = TestBed.inject || TestBed.get;
export async function render(
component: Type,
@@ -129,7 +130,6 @@ export async function render(
fixture.componentRef.injector.get(ChangeDetectorRef).detectChanges();
};
- const inject = TestBed.inject || TestBed.get;
let router = routes ? inject(Router) : null;
const zone = inject(NgZone);
const navigate = async (elementOrPath: Element | string, basePath = '') => {
@@ -185,7 +185,7 @@ export async function render(
async function createComponent(component: Type): Promise> {
/* Make sure angular application is initialized before creating component */
- await TestBed.inject(ApplicationInitStatus).donePromise;
+ await inject(ApplicationInitStatus).donePromise;
return TestBed.createComponent(component);
}