-
This is an editor instance.
+
This is an editor instance.
diff --git a/tests/manual/basic-styles.js b/tests/manual/basic-styles.js
index 573e483..96b175c 100644
--- a/tests/manual/basic-styles.js
+++ b/tests/manual/basic-styles.js
@@ -12,11 +12,12 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import Undo from '@ckeditor/ckeditor5-undo/src/undo';
import Bold from '../../src/bold';
import Italic from '../../src/italic';
+import Underline from '../../src/underline';
ClassicEditor
.create( document.querySelector( '#editor' ), {
- plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic ],
- toolbar: [ 'bold', 'italic', 'undo', 'redo' ]
+ plugins: [ Enter, Typing, Paragraph, Undo, Bold, Italic, Underline ],
+ toolbar: [ 'bold', 'italic', 'underline', 'undo', 'redo' ]
} )
.then( editor => {
window.editor = editor;
diff --git a/tests/manual/basic-styles.md b/tests/manual/basic-styles.md
index dbbeeb4..1056bfa 100644
--- a/tests/manual/basic-styles.md
+++ b/tests/manual/basic-styles.md
@@ -2,5 +2,6 @@
1. The data should be loaded with:
* italic "This",
- * bold "editor".
-2. Test the bold and italic features live.
+ * bold "editor",
+ * underline "instance".
+2. Test the bold, italic and underline features live.
diff --git a/tests/underline.js b/tests/underline.js
new file mode 100644
index 0000000..3243381
--- /dev/null
+++ b/tests/underline.js
@@ -0,0 +1,95 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals document */
+
+import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
+import Underline from '../src/underline';
+import UnderlineEngine from '../src/underlineengine';
+import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
+import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
+import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
+
+testUtils.createSinonSandbox();
+
+describe( 'Underline', () => {
+ let editor, underlineView;
+
+ beforeEach( () => {
+ const editorElement = document.createElement( 'div' );
+ document.body.appendChild( editorElement );
+
+ return ClassicTestEditor
+ .create( editorElement, {
+ plugins: [ Underline ]
+ } )
+ .then( newEditor => {
+ editor = newEditor;
+
+ underlineView = editor.ui.componentFactory.create( 'underline' );
+ } );
+ } );
+
+ afterEach( () => {
+ return editor.destroy();
+ } );
+
+ it( 'should be loaded', () => {
+ expect( editor.plugins.get( Underline ) ).to.be.instanceOf( Underline );
+ } );
+
+ it( 'should load UnderlineEngine', () => {
+ expect( editor.plugins.get( UnderlineEngine ) ).to.be.instanceOf( UnderlineEngine );
+ } );
+
+ it( 'should register underline feature component', () => {
+ expect( underlineView ).to.be.instanceOf( ButtonView );
+ expect( underlineView.isOn ).to.be.false;
+ expect( underlineView.label ).to.equal( 'Underline' );
+ expect( underlineView.icon ).to.match( /