Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add tests for checking if each mode has its own 'mode' class
Browse files Browse the repository at this point in the history
  • Loading branch information
panr committed Dec 19, 2019
1 parent 4dd1ccb commit a702043
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/restrictededitingmodeediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ describe( 'RestrictedEditingModeEditing', () => {
expect( editor.plugins.get( RestrictedEditingModeEditing ) ).to.be.instanceOf( RestrictedEditingModeEditing );
} );

it( 'should have "ck-restricted-editing_mode_restricted" class', () => {
for ( const root of editor.editing.view.document.roots ) {
expect( root.hasClass( 'ck-restricted-editing_mode_restricted' ) ).to.be.true;
}
} );

it( 'adds a "goToPreviousRestrictedEditingException" command', () => {
expect( editor.commands.get( 'goToPreviousRestrictedEditingException' ) )
.to.be.instanceOf( RestrictedEditingModeNavigationCommand );
Expand Down
6 changes: 6 additions & 0 deletions tests/standardeditingmodeediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ describe( 'StandardEditingModeEditing', () => {
expect( editor.plugins.get( 'StandardEditingModeEditing' ) ).to.be.instanceOf( StandardEditingModeEditing );
} );

it( 'should have "ck-restricted-editing_mode_standard" class', () => {
for ( const root of editor.editing.view.document.roots ) {
expect( root.hasClass( 'ck-restricted-editing_mode_standard' ) ).to.be.true;
}
} );

it( 'should set proper schema rules', () => {
expect( model.schema.checkAttribute( [ '$root', '$text' ], 'restrictedEditingException' ) ).to.be.true;

Expand Down

0 comments on commit a702043

Please sign in to comment.