From ec83c3bc57f5acdef95aec38ac20fd9548b4db67 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Apr 2022 14:38:49 -0500 Subject: [PATCH 1/6] LandingPage: conditional registration flow --- .../components/registration_form.js | 2 +- .../__tests__/landing_page-test.tsx | 86 +++++++++++++++++++ .../landing_page/{index.js => index.tsx} | 56 ++++++++---- app/soapbox/jest/test-helpers.tsx | 1 + app/soapbox/utils/__tests__/features-test.js | 18 ++++ app/soapbox/utils/features.ts | 1 + 6 files changed, 147 insertions(+), 17 deletions(-) create mode 100644 app/soapbox/features/landing_page/__tests__/landing_page-test.tsx rename app/soapbox/features/landing_page/{index.js => index.tsx} (57%) diff --git a/app/soapbox/features/auth_login/components/registration_form.js b/app/soapbox/features/auth_login/components/registration_form.js index 87de069c7..898a1b7bd 100644 --- a/app/soapbox/features/auth_login/components/registration_form.js +++ b/app/soapbox/features/auth_login/components/registration_form.js @@ -261,7 +261,7 @@ class RegistrationForm extends ImmutablePureComponent { const isLoading = this.state.captchaLoading || this.state.submissionLoading; return ( - +
diff --git a/app/soapbox/features/landing_page/__tests__/landing_page-test.tsx b/app/soapbox/features/landing_page/__tests__/landing_page-test.tsx new file mode 100644 index 000000000..ce0ce778c --- /dev/null +++ b/app/soapbox/features/landing_page/__tests__/landing_page-test.tsx @@ -0,0 +1,86 @@ +import * as React from 'react'; + +import LandingPage from '..'; +import { INSTANCE_REMEMBER_SUCCESS } from '../../../actions/instance'; +import { PEPE_FETCH_INSTANCE_SUCCESS } from '../../../actions/verification'; +import { render, screen, rootReducer, applyActions } from '../../../jest/test-helpers'; + +describe('', () => { + it('renders a RegistrationForm for an open Pleroma instance', () => { + + const state = rootReducer(undefined, { + type: INSTANCE_REMEMBER_SUCCESS, + instance: { + version: '2.7.2 (compatible; Pleroma 2.3.0)', + registrations: true, + }, + }); + + render(, null, state); + + expect(screen.queryByTestId('registrations-open')).toBeInTheDocument(); + expect(screen.queryByTestId('registrations-closed')).not.toBeInTheDocument(); + expect(screen.queryByTestId('registrations-pepe')).not.toBeInTheDocument(); + }); + + it('renders "closed" message for a closed Pleroma instance', () => { + + const state = rootReducer(undefined, { + type: INSTANCE_REMEMBER_SUCCESS, + instance: { + version: '2.7.2 (compatible; Pleroma 2.3.0)', + registrations: false, + }, + }); + + render(, null, state); + + expect(screen.queryByTestId('registrations-closed')).toBeInTheDocument(); + expect(screen.queryByTestId('registrations-open')).not.toBeInTheDocument(); + expect(screen.queryByTestId('registrations-pepe')).not.toBeInTheDocument(); + }); + + it('renders Pepe flow for an open Truth Social instance', () => { + + const state = applyActions(undefined, [{ + type: INSTANCE_REMEMBER_SUCCESS, + instance: { + version: '3.4.1 (compatible; TruthSocial 1.0.0)', + registrations: false, + }, + }, { + type: PEPE_FETCH_INSTANCE_SUCCESS, + instance: { + registrations: true, + }, + }], rootReducer); + + render(, null, state); + + expect(screen.queryByTestId('registrations-pepe')).toBeInTheDocument(); + expect(screen.queryByTestId('registrations-open')).not.toBeInTheDocument(); + expect(screen.queryByTestId('registrations-closed')).not.toBeInTheDocument(); + }); + + it('renders "closed" message for a Truth Social instance with Pepe closed', () => { + + const state = applyActions(undefined, [{ + type: INSTANCE_REMEMBER_SUCCESS, + instance: { + version: '3.4.1 (compatible; TruthSocial 1.0.0)', + registrations: false, + }, + }, { + type: PEPE_FETCH_INSTANCE_SUCCESS, + instance: { + registrations: false, + }, + }], rootReducer); + + render(, null, state); + + expect(screen.queryByTestId('registrations-closed')).toBeInTheDocument(); + expect(screen.queryByTestId('registrations-pepe')).not.toBeInTheDocument(); + expect(screen.queryByTestId('registrations-open')).not.toBeInTheDocument(); + }); +}); diff --git a/app/soapbox/features/landing_page/index.js b/app/soapbox/features/landing_page/index.tsx similarity index 57% rename from app/soapbox/features/landing_page/index.js rename to app/soapbox/features/landing_page/index.tsx index 9cf1edf93..e936342e3 100644 --- a/app/soapbox/features/landing_page/index.js +++ b/app/soapbox/features/landing_page/index.tsx @@ -1,18 +1,21 @@ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { useSelector } from 'react-redux'; import VerificationBadge from 'soapbox/components/verification_badge'; +import RegistrationForm from 'soapbox/features/auth_login/components/registration_form'; +import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { Button, Card, CardBody, Stack, Text } from '../../components/ui'; const LandingPage = () => { - const instance = useSelector((state) => state.get('instance')); - const isOpen = useSelector(state => state.getIn(['verification', 'instance', 'registrations'], false) === true); + const features = useFeatures(); + const instance = useAppSelector((state) => state.instance); + const pepeOpen = useAppSelector(state => state.verification.getIn(['instance', 'registrations'], false) === true); + /** Registrations are closed */ const renderClosed = () => { return ( - + { ); }; + /** Mastodon API registrations are open */ + const renderOpen = () => { + return ; + }; + + /** Pepe API registrations are open */ + const renderPepe = () => { + return ( + + + + + Let's get started! + Social Media Without Discrimination + + + + + ); + }; + + // Render registration flow depending on features + const renderBody = () => { + if (features.pepe && pepeOpen) { + return renderPepe(); + } else if (instance.registrations) { + return renderOpen(); + } else { + return renderClosed(); + } + }; + return (
@@ -49,18 +84,7 @@ const LandingPage = () => {
- {isOpen ? ( - - - - - Let's get started! - Social Media Without Discrimination - - - - - ) : renderClosed()} + {renderBody()}
diff --git a/app/soapbox/jest/test-helpers.tsx b/app/soapbox/jest/test-helpers.tsx index 75dc51f32..7a4f8f53b 100644 --- a/app/soapbox/jest/test-helpers.tsx +++ b/app/soapbox/jest/test-helpers.tsx @@ -69,4 +69,5 @@ export { mockStore, applyActions, rootState, + rootReducer, }; diff --git a/app/soapbox/utils/__tests__/features-test.js b/app/soapbox/utils/__tests__/features-test.js index 1531a83ab..6caa38a7b 100644 --- a/app/soapbox/utils/__tests__/features-test.js +++ b/app/soapbox/utils/__tests__/features-test.js @@ -109,4 +109,22 @@ describe('getFeatures', () => { expect(features.focalPoint).toBe(false); }); }); + + describe('pepe', () => { + it('is true for Truth Social', () => { + const instance = InstanceRecord({ + version: '3.4.1 (compatible; TruthSocial 1.0.0)', + }); + const features = getFeatures(instance); + expect(features.pepe).toBe(true); + }); + + it('is false for Pleroma', () => { + const instance = InstanceRecord({ + version: '2.7.2 (compatible; Pleroma 2.3.0)', + }); + const features = getFeatures(instance); + expect(features.pepe).toBe(false); + }); + }); }); diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index c3452bef5..4f70f9341 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -130,6 +130,7 @@ const getInstanceFeatures = (instance: Instance) => { ]), trendingTruths: v.software === TRUTHSOCIAL, trendingStatuses: v.software === MASTODON && gte(v.compatVersion, '3.5.0'), + pepe: v.software === TRUTHSOCIAL, }; }; From df84ec94613786aa69511a36bc60ff6ab02df4af Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Apr 2022 15:01:16 -0500 Subject: [PATCH 2/6] tsconfig: enable esModuleInterop --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index beff5f647..81de33908 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "moduleResolution": "node", "resolveJsonModule": true, "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, + "esModuleInterop": true, "typeRoots": [ "./types", "./node_modules/@types"] }, "exclude": ["node_modules", "types", "**/*.test.*", "**/__mocks__/*", "**/__tests__/*"] From a7d450a7c0f88cfe430541d2f9dd051f72aca35c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Apr 2022 15:01:31 -0500 Subject: [PATCH 3/6] Fix landing_page test filename --- .../__tests__/{landing_page-test.tsx => landing_page.test.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/soapbox/features/landing_page/__tests__/{landing_page-test.tsx => landing_page.test.tsx} (100%) diff --git a/app/soapbox/features/landing_page/__tests__/landing_page-test.tsx b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx similarity index 100% rename from app/soapbox/features/landing_page/__tests__/landing_page-test.tsx rename to app/soapbox/features/landing_page/__tests__/landing_page.test.tsx From 48fb37a90ddebec809956aaa28b1dc9566f8b6ae Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 5 Apr 2022 18:06:30 -0500 Subject: [PATCH 4/6] Layout: convert to tsx, use react-stickynode again --- .../ui/layout/{layout.js => layout.tsx} | 41 ++++++------------- package.json | 1 + yarn.lock | 7 ++++ 3 files changed, 21 insertions(+), 28 deletions(-) rename app/soapbox/components/ui/layout/{layout.js => layout.tsx} (51%) diff --git a/app/soapbox/components/ui/layout/layout.js b/app/soapbox/components/ui/layout/layout.tsx similarity index 51% rename from app/soapbox/components/ui/layout/layout.js rename to app/soapbox/components/ui/layout/layout.tsx index 976ef25cb..4ee50564a 100644 --- a/app/soapbox/components/ui/layout/layout.js +++ b/app/soapbox/components/ui/layout/layout.tsx @@ -1,8 +1,8 @@ import classNames from 'classnames'; -import PropTypes from 'prop-types'; import React from 'react'; +import Sticky from 'react-stickynode'; -const Layout = ({ children }) => ( +const Layout: React.FC = ({ children }) => (
{children} @@ -11,52 +11,37 @@ const Layout = ({ children }) => ( ); -const Sidebar = ({ children }) => ( +const Sidebar: React.FC = ({ children }) => (
-
+ {children} -
+
); -const Main = ({ children, className }) => ( +const Main: React.FC> = ({ children, className }) => (
{children}
); -const Aside = ({ children }) => ( +const Aside: React.FC = ({ children }) => ( ); -Layout.propTypes = { - children: PropTypes.node.isRequired, -}; - -Sidebar.propTypes = { - children: PropTypes.node, -}; - -Main.propTypes = { - children: PropTypes.node, - className: PropTypes.string, -}; - -Aside.propTypes = { - children: PropTypes.node, -}; - +// @ts-ignore Layout.Sidebar = Sidebar; +// @ts-ignore Layout.Main = Main; +// @ts-ignore Layout.Aside = Aside; export default Layout; diff --git a/package.json b/package.json index 517ff0761..e01161954 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "@types/react-helmet": "^6.1.5", "@types/react-motion": "^0.0.32", "@types/react-router-dom": "^5.3.3", + "@types/react-stickynode": "^4.0.0", "@types/react-toggle": "^4.0.3", "@types/redux-mock-store": "^1.0.3", "@types/semver": "^7.3.9", diff --git a/yarn.lock b/yarn.lock index ca2fc244d..1881d59f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2219,6 +2219,13 @@ "@types/history" "^4.7.11" "@types/react" "*" +"@types/react-stickynode@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/react-stickynode/-/react-stickynode-4.0.0.tgz#54ba7ceab9bd563bccdcae72c7486a626e870ecb" + integrity sha512-PKkmOzF6WCNuyIKrvhidGeUPLfe8htPwfEljKnQBF4bA5v74ADvXtwkjavOH8i6aCSw9J14AyDDl1Ul0VNQJUg== + dependencies: + "@types/react" "*" + "@types/react-toggle@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/react-toggle/-/react-toggle-4.0.3.tgz#8db98ac8d2c5e8c03c2d3a42027555c1cd2289da" From fe4c2d5c5b6a8cc64a2b336d4152e4cb8044fa4e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 6 Apr 2022 10:04:06 -0500 Subject: [PATCH 5/6] Try using react-sticky-box instead of react-stickynode --- app/soapbox/components/ui/layout/layout.tsx | 10 ++-- package.json | 3 +- yarn.lock | 51 ++++++--------------- 3 files changed, 19 insertions(+), 45 deletions(-) diff --git a/app/soapbox/components/ui/layout/layout.tsx b/app/soapbox/components/ui/layout/layout.tsx index 4ee50564a..f8c84f37e 100644 --- a/app/soapbox/components/ui/layout/layout.tsx +++ b/app/soapbox/components/ui/layout/layout.tsx @@ -1,6 +1,6 @@ import classNames from 'classnames'; import React from 'react'; -import Sticky from 'react-stickynode'; +import StickyBox from 'react-sticky-box'; const Layout: React.FC = ({ children }) => (
@@ -13,9 +13,9 @@ const Layout: React.FC = ({ children }) => ( const Sidebar: React.FC = ({ children }) => (
- + {children} - +
); @@ -31,9 +31,9 @@ const Main: React.FC> = ({ children, classN const Aside: React.FC = ({ children }) => ( ); diff --git a/package.json b/package.json index e01161954..c14cd88ae 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,6 @@ "@types/react-helmet": "^6.1.5", "@types/react-motion": "^0.0.32", "@types/react-router-dom": "^5.3.3", - "@types/react-stickynode": "^4.0.0", "@types/react-toggle": "^4.0.3", "@types/redux-mock-store": "^1.0.3", "@types/semver": "^7.3.9", @@ -165,7 +164,7 @@ "react-router-scroll-4": "^1.0.0-beta.1", "react-simple-pull-to-refresh": "^1.3.0", "react-sparklines": "^1.7.0", - "react-stickynode": "^4.0.0", + "react-sticky-box": "^1.0.2", "react-swipeable-views": "^0.14.0", "react-textarea-autosize": "^8.3.3", "react-toggle": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 1881d59f7..d86daa869 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2219,13 +2219,6 @@ "@types/history" "^4.7.11" "@types/react" "*" -"@types/react-stickynode@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/react-stickynode/-/react-stickynode-4.0.0.tgz#54ba7ceab9bd563bccdcae72c7486a626e870ecb" - integrity sha512-PKkmOzF6WCNuyIKrvhidGeUPLfe8htPwfEljKnQBF4bA5v74ADvXtwkjavOH8i6aCSw9J14AyDDl1Ul0VNQJUg== - dependencies: - "@types/react" "*" - "@types/react-toggle@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/react-toggle/-/react-toggle-4.0.3.tgz#8db98ac8d2c5e8c03c2d3a42027555c1cd2289da" @@ -3451,7 +3444,7 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== -classnames@^2.0.0, classnames@^2.2.5, classnames@^2.2.6: +classnames@^2.2.5, classnames@^2.2.6: version "2.3.1" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== @@ -3694,7 +3687,7 @@ core-js@^2.4.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-js@^3.1.3, core-js@^3.15.2, core-js@^3.6.5: +core-js@^3.1.3, core-js@^3.15.2: version "3.18.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.0.tgz#9af3f4a6df9ba3428a3fb1b171f1503b3f40cc49" integrity sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w== @@ -4813,11 +4806,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -eventemitter3@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" - integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== - eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -8632,7 +8620,7 @@ quote@^0.4.0: resolved "https://registry.yarnpkg.com/quote/-/quote-0.4.0.tgz#10839217f6c1362b89194044d29b233fd7f32f01" integrity sha1-EIOSF/bBNiuJGUBE0psjP9fzLwE= -raf@^3.0.0, raf@^3.1.0, raf@^3.4.1: +raf@^3.1.0, raf@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== @@ -8917,16 +8905,12 @@ react-sparklines@^1.7.0: dependencies: prop-types "^15.5.10" -react-stickynode@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/react-stickynode/-/react-stickynode-4.0.0.tgz#ca1deeda866aeace3d522d01eb868f286cdb49d1" - integrity sha512-H6Ae6l8soAc188eFAmE4CGJz3oidQa88jNO/fnJWjpFw4DwGRS6boL9gHNE4DCvbMPgek1AAP85pUPIEKUMgtw== +react-sticky-box@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/react-sticky-box/-/react-sticky-box-1.0.2.tgz#7e72a0f237bdf8270cec9254337f49519a411174" + integrity sha512-Kyvtppdtv1KqJyNU4DtrSMI0unyQRgtraZvVQ0GAazVbYiTsIVpyhpr+5R0Aavzu4uJNSe1awj2rk/qI7i6Zfw== dependencies: - classnames "^2.0.0" - core-js "^3.6.5" - prop-types "^15.6.0" - shallowequal "^1.0.0" - subscribe-ui-event "^2.0.6" + resize-observer-polyfill "^1.5.1" react-swipeable-views-core@^0.14.0: version "0.14.0" @@ -9247,6 +9231,11 @@ reselect@^4.0.0: resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.0.0.tgz#f2529830e5d3d0e021408b246a206ef4ea4437f7" integrity sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA== +resize-observer-polyfill@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -9551,11 +9540,6 @@ shallow-equal@^1.2.1: resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== -shallowequal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" - integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -9994,15 +9978,6 @@ stylelint@^13.7.2: v8-compile-cache "^2.3.0" write-file-atomic "^3.0.3" -subscribe-ui-event@^2.0.6: - version "2.0.7" - resolved "https://registry.yarnpkg.com/subscribe-ui-event/-/subscribe-ui-event-2.0.7.tgz#8d18b6339c35b25246a5335775573f0e5dc461f8" - integrity sha512-Acrtf9XXl6lpyHAWYeRD1xTPUQHDERfL4GHeNuYAtZMc4Z8Us2iDBP0Fn3xiRvkQ1FO+hx+qRLmPEwiZxp7FDQ== - dependencies: - eventemitter3 "^3.0.0" - lodash "^4.17.15" - raf "^3.0.0" - substring-trie@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/substring-trie/-/substring-trie-1.0.2.tgz#7b42592391628b4f2cb17365c6cce4257c7b7af5" From 19eae5c010ca92b1d231379696a142ee2572c101 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 6 Apr 2022 11:13:21 -0500 Subject: [PATCH 6/6] Jest: transpile react-sticky-box --- jest.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 7d0f467f4..c2c762be2 100644 --- a/jest.config.js +++ b/jest.config.js @@ -35,8 +35,11 @@ module.exports = { 'testMatch': ['**/*/__tests__/**/?(*.|*-)+(test).(ts|js)?(x)'], 'testEnvironment': 'jsdom', 'transformIgnorePatterns': [ + // FIXME: react-sticky-box doesn't provide a CJS build, so transform it for now + // https://github.com/codecks-io/react-sticky-box/issues/79 + `/node_modules/(?!(react-sticky-box|.+\\.(${ASSET_EXTS})))`, // Ignore node_modules, except static assets - `/node_modules/(?!.+\\.(${ASSET_EXTS}))`, + // `/node_modules/(?!.+\\.(${ASSET_EXTS}))`, ], 'transform': { '\\.[jt]sx?$': 'babel-jest',