From e1dbb55222f26689139296d119acdd4f424ae870 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 8 Apr 2024 14:38:28 +0200 Subject: [PATCH 1/5] test: Stop running with unsupported Node.js versions (#1296) --- .github/workflows/validate.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1ef5141d..e0098c08 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -29,7 +29,7 @@ jobs: # Otherwise we would not know if the problem is tied to the Node.js version fail-fast: false matrix: - node: [14, 16, 18, 20] + node: [18, 20] runs-on: ubuntu-latest steps: - name: ⬇️ Checkout repo @@ -43,10 +43,6 @@ jobs: with: node-version: ${{ matrix.node }} - # Ideally done by actions/setup-node: https://github.com/actions/setup-node/issues/213 - - name: Setup package manager - run: npm install -g npm@9.2.0 - - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: @@ -85,10 +81,6 @@ jobs: with: node-version: 18 - # Ideally done by actions/setup-node: https://github.com/actions/setup-node/issues/213 - - name: Setup package manager - run: npm install -g npm@9.2.0 - - name: 📥 Download deps uses: bahmutov/npm-install@v1 with: From 5c7f2e836799873edd700b42df56b9264a457cc8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:49:32 +0300 Subject: [PATCH 2/5] docs: add jlp-craigmorten as a contributor for question (#1298) * docs: update README.md * docs: update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 5b699465..0a043692 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1605,7 +1605,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/124147726?v=4", "profile": "https://github.com/jlp-craigmorten", "contributions": [ - "code" + "code", + "question" ] }, { diff --git a/README.md b/README.md index 2323bb5b..95795366 100644 --- a/README.md +++ b/README.md @@ -343,7 +343,7 @@ Thanks goes to these people ([emoji key][emojis]): Raphaël LEMIEUX
Raphaël LEMIEUX

💻 Arthur Lauck Vilas Boas
Arthur Lauck Vilas Boas

📖 Daniel Acuña
Daniel Acuña

💻 - Craig Morten
Craig Morten

💻 + Craig Morten
Craig Morten

💻 💬 Naor Peled
Naor Peled

💻 Julien Wajsberg
Julien Wajsberg

💻 🐛 Kevin BON
Kevin BON

💻 🐛 From 791735855b0922fedc1bafd4efbdb9c76457c4fd Mon Sep 17 00:00:00 2001 From: Matan Borenkraout Date: Thu, 18 Apr 2024 20:37:41 +0300 Subject: [PATCH 3/5] docs: update reproduction link (#1304) * docs: update reproduction link * update codesandbox reference * remove redundant a * code review suggestion Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> --------- Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/Bug_Report.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.md b/.github/ISSUE_TEMPLATE/Bug_Report.md index b1205113..72faa5f4 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.md +++ b/.github/ISSUE_TEMPLATE/Bug_Report.md @@ -54,8 +54,8 @@ minimal amount of code possible. Repository template: https://github.com/testing-library/dom-testing-library-template -Or if you can, try to reproduce the issue in a Codesandbox. You can fork the one -here: https://codesandbox.io/s/5z6x4r7n0p +Or if you can, try to reproduce the issue in StackBlitz. You can fork the one +here: https://testing-library.com/new-dtl --> ### Problem description: From 47fe879f572e2cfb2ca1e40d1ebcdffdd34a79eb Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 28 Apr 2024 00:49:02 -0700 Subject: [PATCH 4/5] chore: correct some typos and spelling errors (#1309) --- src/__tests__/role.js | 12 ++++++------ src/__tests__/wait-for-element-to-be-removed.js | 2 +- src/queries/role.ts | 2 +- src/screen.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/__tests__/role.js b/src/__tests__/role.js index fe31c2ea..447a6e8b 100644 --- a/src/__tests__/role.js +++ b/src/__tests__/role.js @@ -199,16 +199,16 @@ test('can be filtered by accessible name', () => { `

Order

-

Delivery Adress

-
+

Delivery Address

+
-

Invoice Adress

-
+

Invoice Address

+
`, ) - const deliveryForm = getByRole('form', {name: 'Delivery Adress'}) + const deliveryForm = getByRole('form', {name: 'Delivery Address'}) expect(deliveryForm).not.toBeNull() expect( getQueriesForElement(deliveryForm).getByRole('button', {name: 'Submit'}), ).not.toBeNull() - const invoiceForm = getByRole('form', {name: 'Delivery Adress'}) + const invoiceForm = getByRole('form', {name: 'Delivery Address'}) expect(invoiceForm).not.toBeNull() expect( diff --git a/src/__tests__/wait-for-element-to-be-removed.js b/src/__tests__/wait-for-element-to-be-removed.js index 6ea0a091..4b6732e8 100644 --- a/src/__tests__/wait-for-element-to-be-removed.js +++ b/src/__tests__/wait-for-element-to-be-removed.js @@ -80,7 +80,7 @@ test('requires an unempty array of elements to exist first (function form)', () ) }) -test('after successful removal, fullfills promise with empty value (undefined)', () => { +test('after successful removal, fulfills promise with empty value (undefined)', () => { const {getByTestId} = renderIntoDocument(`
`) diff --git a/src/queries/role.ts b/src/queries/role.ts index 98b08848..e4dd395f 100644 --- a/src/queries/role.ts +++ b/src/queries/role.ts @@ -108,7 +108,7 @@ const queryAllByRole: AllByRole = ( /* istanbul ignore next */ // guard against unknown roles // All currently released ARIA versions support `aria-current` on all roles. - // Leaving this for symetry and forward compatibility + // Leaving this for symmetry and forward compatibility if ( allRoles.get(role as ARIARoleDefinitionKey)?.props['aria-current'] === undefined diff --git a/src/screen.ts b/src/screen.ts index fbe372ff..0c2c51e9 100644 --- a/src/screen.ts +++ b/src/screen.ts @@ -1,4 +1,4 @@ -// WARNING: `lz-string` only has a default export but statically we assume named exports are allowd +// WARNING: `lz-string` only has a default export but statically we assume named exports are allowed // TODO: Statically verify we don't rely on NodeJS implicit named imports. import lzString from 'lz-string' import {type OptionsReceived} from 'pretty-format' From 56543d51a8776d3bc7fa9b947771ce5308bf5df4 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 29 Apr 2024 00:44:57 -0700 Subject: [PATCH 5/5] feat: Add window events "pagehide" / "pageshow" (#1308) MDN documentation at: https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event By adding these events, it allows library users to use the familiar fireEvent & friends in their test environments to verify pagehide and pageshow behavior. Co-authored-by: Matan Borenkraout --- src/__tests__/events.js | 4 ++-- src/event-map.js | 8 ++++++++ types/events.d.ts | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/__tests__/events.js b/src/__tests__/events.js index 20d01b0d..f96c0da1 100644 --- a/src/__tests__/events.js +++ b/src/__tests__/events.js @@ -77,8 +77,8 @@ const eventTypes = [ elementType: 'img', }, { - type: '', - events: ['offline', 'online'], + type: 'Window', + events: ['offline', 'online', 'pageHide', 'pageShow'], elementType: 'window', }, { diff --git a/src/event-map.js b/src/event-map.js index 30e4f9d0..08676759 100644 --- a/src/event-map.js +++ b/src/event-map.js @@ -372,6 +372,14 @@ export const eventMap = { EventType: 'Event', defaultInit: {bubbles: false, cancelable: false}, }, + pageHide: { + EventType: 'PageTransitionEvent', + defaultInit: {bubbles: true, cancelable: true}, + }, + pageShow: { + EventType: 'PageTransitionEvent', + defaultInit: {bubbles: true, cancelable: true}, + }, } export const eventAliasMap = { diff --git a/types/events.d.ts b/types/events.d.ts index 57a7edd6..b524c189 100644 --- a/types/events.d.ts +++ b/types/events.d.ts @@ -88,6 +88,8 @@ export type EventType = | 'lostPointerCapture' | 'offline' | 'online' + | 'pageHide' + | 'pageShow' export type FireFunction = ( element: Document | Element | Window | Node,