-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scrollable: Convert component to TypeScript (#42016)
* Scrollable: Convert component to TypeScript * Update CHANGELOG.md
- Loading branch information
Petter Walbø Johnsgård
authored
Jul 1, 2022
1 parent
4ca5ef6
commit 5f39e3d
Showing
11 changed files
with
107 additions
and
95 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
File renamed without changes.
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
File renamed without changes.
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,34 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { Scrollable } from '../index'; | ||
|
||
describe( 'props', () => { | ||
beforeEach( () => { | ||
render( | ||
<Scrollable data-testid="scrollable"> | ||
WordPress.org - Code is Poetry | ||
</Scrollable> | ||
); | ||
} ); | ||
|
||
test( 'should render correctly', () => { | ||
expect( screen.getByTestId( 'scrollable' ) ).toMatchSnapshot(); | ||
} ); | ||
|
||
test( 'should render smoothScroll', () => { | ||
render( | ||
<Scrollable smoothScroll data-testid="smooth-scrollable"> | ||
WordPress.org - Code is Poetry | ||
</Scrollable> | ||
); | ||
expect( | ||
screen.getByTestId( 'smooth-scrollable' ) | ||
).toMatchStyleDiffSnapshot( screen.getByTestId( 'scrollable' ) ); | ||
} ); | ||
} ); |
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