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

Commit

Permalink
Tests: Fixed the manual test of the theme, broken after createTestUIV…
Browse files Browse the repository at this point in the history
…iew() helper became synchronous (see ckeditor/ckeditor5-ui#225).
  • Loading branch information
oleq committed Jul 6, 2017
1 parent beae04d commit 06e3a6d
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions tests/manual/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,28 @@ import italicIcon from '@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg'

import '../../theme/theme.scss';

testUtils.createTestUIView( {
class TextView extends View {
constructor() {
super();

this.element = document.createTextNode( 'Sample text' );
}
}

class ToolbarNewlineView extends View {
constructor() {
super();

this.template = new Template( {
tag: 'span',
attributes: {
class: 'ck-toolbar__newline'
}
} );
}
}

const ui = testUtils.createTestUIView( {
'iconPlain1': '#icon-plain-1',
'iconPlain2': '#icon-plain-2',
'iconColor1': '#icon-color-1',
Expand All @@ -47,14 +68,14 @@ testUtils.createTestUIView( {
'toolbarWrap': '#toolbar-wrap',
'toolbarSeparator': '#toolbar-separator',
'toolbarMultiRow': '#toolbar-multi-row'
} ).then( ui => {
renderIcon( ui );
renderButton( ui );
renderDropdown( ui );
renderToolbar( ui );
} );

function renderIcon( ui ) {
renderIcon();
renderButton();
renderDropdown();
renderToolbar();

function renderIcon() {
// --- In-text ------------------------------------------------------------

ui.iconPlain1.add( icon( boldIcon ) );
Expand All @@ -63,7 +84,7 @@ function renderIcon( ui ) {
ui.iconColor2.add( icon( italicIcon ) );
}

function renderButton( ui ) {
function renderButton() {
// --- States ------------------------------------------------------------

ui.buttonStates.add( button( {
Expand Down Expand Up @@ -168,7 +189,7 @@ function renderButton( ui ) {
}
}

function renderDropdown( ui ) {
function renderDropdown() {
// --- ListDropdown ------------------------------------------------------------

const collection = new Collection( { idProperty: 'label' } );
Expand Down Expand Up @@ -197,7 +218,7 @@ function renderDropdown( ui ) {
} ) );
}

function renderToolbar( ui ) {
function renderToolbar() {
// --- Text ------------------------------------------------------------

ui.toolbarText.add( toolbar( [
Expand Down Expand Up @@ -280,14 +301,6 @@ function renderToolbar( ui ) {
] ) );
}

const TextView = class extends View {
constructor() {
super();

this.element = document.createTextNode( 'Sample text' );
}
};

function text() {
return new TextView();
}
Expand Down Expand Up @@ -339,19 +352,6 @@ function toolbarSeparator() {
return new ToolbarSeparatorView();
}

const ToolbarNewlineView = class extends View {
constructor() {
super();

this.template = new Template( {
tag: 'span',
attributes: {
class: 'ck-toolbar__newline'
}
} );
}
};

function toolbarNewLine() {
return new ToolbarNewlineView();
}

0 comments on commit 06e3a6d

Please sign in to comment.