-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Divider: Complete TypeScript migration of component (#41991)
* Divider: Complete TypeScript migration of component * Update tests * Update CHANGELOG.md * Remove unnecessary index * Sort alphabetically * Move changelog entry * Update storybook to show value of SpaceInput * Revert "Update storybook to show value of SpaceInput" This reverts commit b227e8e. * Update CHANGELOG.md
- Loading branch information
Petter Walbø Johnsgård
committed
Jul 13, 2022
1 parent
d0973e7
commit c777886
Showing
10 changed files
with
89 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { default as Divider } from './component'; | ||
export type { Props as DividerProps } from './types'; | ||
export type { DividerProps } from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { Divider } from '..'; | ||
|
||
describe( 'props', () => { | ||
beforeEach( () => { | ||
render( <Divider /> ); | ||
} ); | ||
|
||
test( 'should render correctly', () => { | ||
expect( screen.getByRole( 'separator' ) ).toMatchSnapshot(); | ||
} ); | ||
|
||
test( 'should render marginStart', () => { | ||
render( <Divider marginStart={ 5 } /> ); | ||
|
||
const dividers = screen.getAllByRole( 'separator' ); | ||
expect( dividers[ 0 ] ).toMatchStyleDiffSnapshot( dividers[ 1 ] ); | ||
} ); | ||
|
||
test( 'should render marginEnd', () => { | ||
render( <Divider marginEnd={ 5 } /> ); | ||
|
||
const dividers = screen.getAllByRole( 'separator' ); | ||
expect( dividers[ 0 ] ).toMatchStyleDiffSnapshot( dividers[ 1 ] ); | ||
} ); | ||
|
||
test( 'should render margin', () => { | ||
render( <Divider margin={ 7 } /> ); | ||
|
||
const dividers = screen.getAllByRole( 'separator' ); | ||
expect( dividers[ 0 ] ).toMatchStyleDiffSnapshot( dividers[ 1 ] ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters