Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FontPicker ref warnings in tests #7875

Closed
swissspidy opened this issue Jun 9, 2021 · 1 comment · Fixed by #8191 or #8256
Closed

FontPicker ref warnings in tests #7875

swissspidy opened this issue Jun 9, 2021 · 1 comment · Fixed by #8191 or #8256
Assignees
Labels
Group: Fonts P2 Should do soon Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️

Comments

@swissspidy
Copy link
Collaborator

Task Description

Getting the following warnings when running JS unit tests:

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `FontPicker`.
    at mockConstructor (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/jest-mock/build/index.js:171:19)
    at FontPicker (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/design/textStyle/fontPicker.js:38:3)
    at div
    at row__Row (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/styled-components/src/models/Keyframes.js:20:51)
    at FontControls (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/design/textStyle/font.js:64:3)
    at div
    at content__Container (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/styled-components/src/models/Keyframes.js:20:51)
    at Content (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/panel/shared/content.js:40:20)
    at /home/runner/work/web-stories-wp/web-stories-wp/node_modules/use-context-selector/src/index.js:29:20
    at section
    at panel__Wrapper (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/styled-components/src/models/Keyframes.js:20:51)
    at Panel (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/panel/panel.js:45:3)
    at SimplePanel (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/panel/simplePanel.js:29:24)
    at textStyle___StyledSimplePanel (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/styled-components/src/models/Keyframes.js:20:51)
    at StylePanel (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/design/textStyle/textStyle.js:34:27)
    at /home/runner/work/web-stories-wp/web-stories-wp/node_modules/use-context-selector/src/index.js:29:20
    at /home/runner/work/web-stories-wp/web-stories-wp/node_modules/use-context-selector/src/index.js:29:20
    at /home/runner/work/web-stories-wp/web-stories-wp/node_modules/use-context-selector/src/index.js:29:20
    at /home/runner/work/web-stories-wp/web-stories-wp/node_modules/use-context-selector/src/index.js:29:20
    at Wrapper (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/design/textStyle/test/textStyle.js:58:20)
    at TestPanel (/home/runner/work/web-stories-wp/web-stories-wp/assets/src/edit-story/components/panels/shared/test/_utils.js:34:3)
    at Object.<anonymous>.exports.ThemeProvider (/home/runner/work/web-stories-wp/web-stories-wp/node_modules/styled-components/src/models/ServerStyleSheet.js:66:13)

Example run: https://github.com/google/web-stories-wp/pull/7855/checks?check_run_id=2772397125#step:9:12

@swissspidy swissspidy added Group: Fonts Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ Pod: Prometheus labels Jun 9, 2021
@miina miina added the P2 Should do soon label Jun 9, 2021
@miina miina removed their assignment Jun 9, 2021
@BrittanyIRL
Copy link
Contributor

This is caused by the double refs created to manage the highlights needed on the quick action menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: Fonts P2 Should do soon Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️
Projects
None yet
4 participants