Skip to content

Commit 20b2888

Browse files
committed
feat: upgrade dom testing library
1 parent 7ce3772 commit 20b2888

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"@angular/router": "^9.0.0",
3636
"@ngrx/store": "^8.0.0-rc.0",
3737
"@phenomnomnominal/tsquery": "^3.0.0",
38-
"@testing-library/dom": "^5.0.1",
38+
"@testing-library/dom": "^6.12.2",
39+
"@testing-library/user-event": "^8.1.0",
3940
"core-js": "^3.1.3",
4041
"rxjs": "^6.5.4",
4142
"tslib": "^1.10.0",

projects/testing-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@angular/core": "^9.0.0"
3030
},
3131
"dependencies": {
32-
"@testing-library/dom": "^5.1.0",
32+
"@testing-library/dom": "^6.12.2",
3333
"@phenomnomnominal/tsquery": "^3.0.0",
3434
"tslint": "^5.16.0"
3535
},

projects/testing-library/src/lib/testing-library.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,13 @@ export async function render<SutType, WrapperType = SutType>(
123123
return result;
124124
};
125125

126-
function componentWaitForDomChange<Result>(options?: {
126+
function componentWaitForDomChange(options?: {
127127
container?: HTMLElement;
128128
timeout?: number;
129129
mutationObserverOptions?: MutationObserverInit;
130-
}): Promise<Result> {
130+
}): Promise<void> {
131131
const interval = setInterval(detectChanges, 10);
132-
return waitForDomChange<Result>({ container: fixture.nativeElement, ...options }).finally(() =>
133-
clearInterval(interval),
134-
);
132+
return waitForDomChange({ container: fixture.nativeElement, ...options }).finally(() => clearInterval(interval));
135133
}
136134

137135
function componentWaitForElement<Result>(

yarn.lock

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@
968968
js-levenshtein "^1.1.3"
969969
semver "^5.5.0"
970970

971-
"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5":
971+
"@babel/runtime@^7.0.0":
972972
version "7.4.5"
973973
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
974974
integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==
@@ -982,6 +982,13 @@
982982
dependencies:
983983
regenerator-runtime "^0.13.2"
984984

985+
"@babel/runtime@^7.6.2":
986+
version "7.8.4"
987+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308"
988+
integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==
989+
dependencies:
990+
regenerator-runtime "^0.13.2"
991+
985992
"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
986993
version "7.4.4"
987994
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
@@ -1456,15 +1463,17 @@
14561463
dependencies:
14571464
defer-to-connect "^1.0.1"
14581465

1459-
"@testing-library/dom@^5.0.1":
1460-
version "5.0.1"
1461-
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-5.0.1.tgz#1673a56f27fd9748576495958a27b0e5a408db5d"
1462-
integrity sha512-HmyN4b/PmSaSB1ku0tWjgnTtyrwNBXEpp44wgfNaDhyj6IJTCWp1GAf4AANoLGItgMsYjepwWOdMyuJ/8iyStQ==
1466+
"@testing-library/dom@^6.12.2":
1467+
version "6.12.2"
1468+
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-6.12.2.tgz#5d549acf43f2e0c23b2abfd4e36d65594c3b2741"
1469+
integrity sha512-KCnvHra5fV+wDxg3wJObGvZFxq7v1DJt829GNFLuRDjKxVNc/B5AdsylNF5PMHFbWMXDsHwM26d2NZcZO9KjbQ==
14631470
dependencies:
1464-
"@babel/runtime" "^7.4.5"
1471+
"@babel/runtime" "^7.6.2"
14651472
"@sheerun/mutationobserver-shim" "^0.3.2"
1466-
pretty-format "^24.8.0"
1467-
wait-for-expect "^1.2.0"
1473+
"@types/testing-library__dom" "^6.0.0"
1474+
aria-query "3.0.0"
1475+
pretty-format "^24.9.0"
1476+
wait-for-expect "^3.0.0"
14681477

14691478
"@testing-library/jest-dom@^4.1.0":
14701479
version "4.1.0"
@@ -1481,6 +1490,11 @@
14811490
pretty-format "^24.0.0"
14821491
redent "^3.0.0"
14831492

1493+
"@testing-library/user-event@^8.1.0":
1494+
version "8.1.0"
1495+
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-8.1.0.tgz#6362a9a01c5a4f612e8ef6eafd69e71e355c9f09"
1496+
integrity sha512-42VHeLj4877FYIlehDQEP24rmixcfkRpPSil8icNKFJfU4pNArI0EPaKCoAaDr/p6NThW+QHFRiwws80PUNFtg==
1497+
14841498
"@types/babel__core@^7.1.0":
14851499
version "7.1.2"
14861500
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
@@ -1617,6 +1631,13 @@
16171631
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
16181632
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
16191633

1634+
"@types/testing-library__dom@^6.0.0":
1635+
version "6.12.0"
1636+
resolved "https://registry.yarnpkg.com/@types/testing-library__dom/-/testing-library__dom-6.12.0.tgz#7d3b9e1ea7c1bda249b08d3b2dee8bb08a57976b"
1637+
integrity sha512-PQ/gzABzc53T68RldZ/sJHKCihtP9ofU8XIgOk+H7tlfoCRdg9mqICio5Fo8j3Z8wo+pOfuDsuPprWsn3YtVmA==
1638+
dependencies:
1639+
pretty-format "^24.3.0"
1640+
16201641
"@types/webpack-sources@^0.1.5":
16211642
version "0.1.5"
16221643
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.5.tgz#be47c10f783d3d6efe1471ff7f042611bd464a92"
@@ -2115,7 +2136,7 @@ argv-formatter@~1.0.0:
21152136
resolved "https://registry.yarnpkg.com/argv-formatter/-/argv-formatter-1.0.0.tgz#a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9"
21162137
integrity sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=
21172138

2118-
aria-query@^3.0.0:
2139+
aria-query@3.0.0, aria-query@^3.0.0:
21192140
version "3.0.0"
21202141
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
21212142
integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=
@@ -9740,7 +9761,7 @@ pretty-format@^24.0.0, pretty-format@^24.8.0:
97409761
ansi-styles "^3.2.0"
97419762
react-is "^16.8.4"
97429763

9743-
pretty-format@^24.9.0:
9764+
pretty-format@^24.3.0, pretty-format@^24.9.0:
97449765
version "24.9.0"
97459766
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9"
97469767
integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==
@@ -12390,10 +12411,10 @@ w3c-xmlserializer@^1.0.1:
1239012411
webidl-conversions "^4.0.2"
1239112412
xml-name-validator "^3.0.0"
1239212413

12393-
wait-for-expect@^1.2.0:
12394-
version "1.2.0"
12395-
resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-1.2.0.tgz#fdab6a26e87d2039101db88bff3d8158e5c3e13f"
12396-
integrity sha512-EJhKpA+5UHixduMBEGhTFuLuVgQBKWxkFbefOdj2bbk2/OpA5Opsc4aUTGmF+qJ+v3kTGxDRNYwKaT4j6g5n8Q==
12414+
wait-for-expect@^3.0.0:
12415+
version "3.0.2"
12416+
resolved "https://registry.yarnpkg.com/wait-for-expect/-/wait-for-expect-3.0.2.tgz#d2f14b2f7b778c9b82144109c8fa89ceaadaa463"
12417+
integrity sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag==
1239712418

1239812419
walker@^1.0.7, walker@~1.0.5:
1239912420
version "1.0.7"

0 commit comments

Comments
 (0)