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

[Feature] Expander improvements #414

Merged
merged 16 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .styleguidist/styleguidist.sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ module.exports = {
{
name: 'Expander',
components: getComponentWithVariants('Expander')([
'ExpanderGroup',
'Expander/Expander',
'ExpanderGroup/ExpanderGroup',
'ExpanderTitle/ExpanderTitle',
'ExpanderContent/ExpanderContent',
]),
},
],
Expand Down
11 changes: 11 additions & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,14 @@ require('jest-axe/extend-expect');
require('@testing-library/jest-dom/extend-expect');

require('jest-styled-components');

/**
* Replace useLayoutEffect with useEffect for jest to suppress unnecessary warnings "useLayoutEffect does nothing on server...".
* We are using jest default environment JSDOM rather than node (for multiple reasons).
* Custom useEnhanced hook handles SSR by using useEffect hook on node environments and useLayoutEffect on browser.
* Due to issues between jest and react, useLayoutEffect gets picked up when using JSDOM but React assumes node env and issues unnecessary warnings.
**/
jest.mock('react', () => ({
...jest.requireActual('react'),
useLayoutEffect: jest.requireActual('react').useEffect,
}));
242 changes: 0 additions & 242 deletions src/components/Expander/Expander.tsx

This file was deleted.

Loading