-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable the verse block for mobile (#21883)
Enable the verse block for production * Remove the devOnly flag to make the verse block not only available on debug builds, but also in production builds. * Add unit test for verse block
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import renderer from 'react-test-renderer'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Verse from '../edit'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { RichText } from '@wordpress/block-editor'; | ||
|
||
describe( 'Verse Block', () => { | ||
it( 'renders without crashing', () => { | ||
const component = renderer.create( | ||
<Verse attributes={ { content: '' } } /> | ||
); | ||
const rendered = component.toJSON(); | ||
expect( rendered ).toBeTruthy(); | ||
} ); | ||
|
||
it( 'renders given text without crashing', () => { | ||
const component = renderer.create( | ||
<Verse attributes={ { content: 'sample text' } } /> | ||
); | ||
const testInstance = component.root; | ||
const richText = testInstance.findByType( RichText ); | ||
expect( richText ).toBeTruthy(); | ||
expect( richText.props.value ).toBe( 'sample text' ); | ||
} ); | ||
} ); |