Skip to content

Commit

Permalink
Improved test description.
Browse files Browse the repository at this point in the history
  • Loading branch information
psmyrek committed Nov 23, 2022
1 parent 4d433c5 commit c7a2697
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/ckeditorcontext.jsx
Expand Up @@ -289,7 +289,7 @@ describe( '<CKEditorContext> Component', () => {
expect( wrapper.instance().contextWatchdog ).to.not.equal( null );
} );

it( 'should destroy the old editor watchdog instance and create a new one after restarting the context', async () => {
it( 'should not create the component watchdog if layout is not ready', async () => {
wrapper = mount(
<CKEditorContext context={ ContextMock } id="1" isLayoutReady={ false }>
<CKEditor editor={ EditorMock } />
Expand All @@ -298,6 +298,8 @@ describe( '<CKEditorContext> Component', () => {

const { watchdog: firstWatchdog } = wrapper.childAt( 0 ).instance();

expect( firstWatchdog ).to.equal( null );

await new Promise( res => {
wrapper.setProps( {
onReady: res,
Expand All @@ -307,7 +309,6 @@ describe( '<CKEditorContext> Component', () => {

const { watchdog: secondWatchdog } = wrapper.childAt( 0 ).instance();

expect( firstWatchdog ).to.equal( null );
expect( secondWatchdog ).to.not.equal( null );
expect( secondWatchdog._contextWatchdog.state ).to.equal( 'ready' );
} );
Expand Down

0 comments on commit c7a2697

Please sign in to comment.