Sfoglia il codice sorgente

Add tests for checking if each mode has its own 'mode' class

panr 6 anni fa
parent
commit
8a8a5c96ee

+ 6 - 0
packages/ckeditor5-restricted-editing/tests/restrictededitingmodeediting.js

@@ -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 );

+ 6 - 0
packages/ckeditor5-restricted-editing/tests/standardeditingmodeediting.js

@@ -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;