From 7a6976294d67ae5e1ad993a557354d14d0f4a34c Mon Sep 17 00:00:00 2001 From: Ashley Ryan Date: Tue, 16 Aug 2022 09:45:35 -0400 Subject: [PATCH] fix: upgrade lit-labs/react version - adopts the fix for boolean getters and setters from https://github.com/lit/lit/issues/2799#issuecomment-1203178300 - fixes an issue introduced in PR #130 where cds-pagination-button was getting disabled="false" rendered --- package-lock.json | 18 ++++++------- projects/react/package.json | 2 +- .../button/__snapshots__/index.test.tsx.snap | 1 - projects/react/src/button/index.test.tsx | 5 ++-- .../date/__snapshots__/index.test.tsx.snap | 1 - .../file/__snapshots__/index.test.tsx.snap | 1 - .../forms/__snapshots__/index.test.tsx.snap | 3 --- .../icon/__snapshots__/index.test.tsx.snap | 25 ++++--------------- .../input/__snapshots__/index.test.tsx.snap | 2 -- .../__snapshots__/index.test.tsx.snap | 1 - projects/react/src/pagination/index.test.tsx | 5 ++-- .../__snapshots__/index.test.tsx.snap | 1 - .../range/__snapshots__/index.test.tsx.snap | 4 --- .../search/__snapshots__/index.test.tsx.snap | 6 ----- .../__snapshots__/index.test.tsx.snap | 6 ----- 15 files changed, 20 insertions(+), 61 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8df2dbba8..1b845eab1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8517,9 +8517,9 @@ } }, "node_modules/@lit-labs/react": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-1.0.4.tgz", - "integrity": "sha512-Sy4RCxTZpTE2TwByjVac6gC7jzr8bCQC6s9bJhhJDKos4ZlN2cqcuVz63n0mpSSr1zxFh+Z0o0VR223l36Y4Ag==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-1.0.8.tgz", + "integrity": "sha512-5qQzixu/bVqI819cNgr/fY8KX0v5C3FmanMaT7Q8qzUJ+EpB4BsOSQwacdaWfNkm7SV4jkWerSHxa9hvncszCA==", "dev": true }, "node_modules/@lit/reactive-element": { @@ -68313,7 +68313,7 @@ "@babel/core": "7.12.0", "@babel/preset-env": "7.12.0", "@cds/core": "file:./../core/dist/lib", - "@lit-labs/react": "^1.0.1", + "@lit-labs/react": "^1.0.8", "@testing-library/dom": "^8.11.3", "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.2", @@ -76178,9 +76178,9 @@ } }, "@lit-labs/react": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-1.0.4.tgz", - "integrity": "sha512-Sy4RCxTZpTE2TwByjVac6gC7jzr8bCQC6s9bJhhJDKos4ZlN2cqcuVz63n0mpSSr1zxFh+Z0o0VR223l36Y4Ag==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@lit-labs/react/-/react-1.0.8.tgz", + "integrity": "sha512-5qQzixu/bVqI819cNgr/fY8KX0v5C3FmanMaT7Q8qzUJ+EpB4BsOSQwacdaWfNkm7SV4jkWerSHxa9hvncszCA==", "dev": true }, "@lit/reactive-element": { @@ -114021,7 +114021,7 @@ "@babel/core": "7.12.0", "@babel/preset-env": "7.12.0", "@cds/core": "file:../core/dist/lib", - "@lit-labs/react": "^1.0.1", + "@lit-labs/react": "1.0.8", "@testing-library/dom": "^8.11.3", "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.2", @@ -114032,7 +114032,7 @@ "@types/react-dom": "^17.0.11", "babel-jest": "^28.1.2", "jest": "^28.1.2", - "jest-environment-jsdom": "28", + "jest-environment-jsdom": "^28.1.2", "lit": "2.0.2", "parcel": "^2.0.0-beta.1", "react": "^17.0.2", diff --git a/projects/react/package.json b/projects/react/package.json index af87ef7e2..a0c17d558 100644 --- a/projects/react/package.json +++ b/projects/react/package.json @@ -17,7 +17,7 @@ "@babel/core": "7.12.0", "@babel/preset-env": "7.12.0", "@cds/core": "file:./../core/dist/lib", - "@lit-labs/react": "^1.0.1", + "@lit-labs/react": "^1.0.8", "@testing-library/dom": "^8.11.3", "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.2", diff --git a/projects/react/src/button/__snapshots__/index.test.tsx.snap b/projects/react/src/button/__snapshots__/index.test.tsx.snap index b617847c4..e6a3acabb 100644 --- a/projects/react/src/button/__snapshots__/index.test.tsx.snap +++ b/projects/react/src/button/__snapshots__/index.test.tsx.snap @@ -18,7 +18,6 @@ exports[`CdsButton snapshot 1`] = ` danger disabled diff --git a/projects/react/src/button/index.test.tsx b/projects/react/src/button/index.test.tsx index b7a371f6c..12557274f 100644 --- a/projects/react/src/button/index.test.tsx +++ b/projects/react/src/button/index.test.tsx @@ -17,9 +17,8 @@ describe('CdsButton', () => { expect(await screen.findByRole('button', { name: 'primary' })).toHaveAttribute('status', 'primary'); expect(await screen.findByRole('button', { name: 'success' })).toHaveAttribute('status', 'success'); - // There's a lit issue that is resulting in this being 'true' instead of '' - // https://github.com/lit/lit/issues/2799#issuecomment-1203178300 - expect(await screen.findByRole('button', { name: 'disabled' })).toHaveAttribute('disabled', 'true'); + expect(await screen.findByRole('button', { name: 'disabled' })).toBeDisabled(); + expect(await screen.findByRole('button', { name: 'disabled' })).toHaveAttribute('disabled', ''); }); it('snapshot', () => { diff --git a/projects/react/src/date/__snapshots__/index.test.tsx.snap b/projects/react/src/date/__snapshots__/index.test.tsx.snap index 3d03de7b4..5b703adf4 100644 --- a/projects/react/src/date/__snapshots__/index.test.tsx.snap +++ b/projects/react/src/date/__snapshots__/index.test.tsx.snap @@ -5,7 +5,6 @@ exports[`CdsDate snapshot 1`] = `