Skip to content

Commit

Permalink
Merge pull request #414 from vrk-kpa/feature/move-expander-to-core
Browse files Browse the repository at this point in the history
[Feature] Expander improvements
  • Loading branch information
aappoalander authored Dec 7, 2020
2 parents 2fd08c9 + b054858 commit 177816a
Show file tree
Hide file tree
Showing 33 changed files with 2,286 additions and 2,110 deletions.
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

0 comments on commit 177816a

Please sign in to comment.