Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
126 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* bender-tags: 13771, config, font, format, stylescombo */ | ||
/* bender-ckeditor-plugins: font, format, stylescombo, toolbar */ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
bender.editors = { | ||
classic: { | ||
config: { | ||
toolbar: [ [ 'Font', 'FontSize', 'Format', 'Styles' ] ] | ||
} | ||
}, | ||
inline: { | ||
creator: 'inline', | ||
config: { | ||
toolbar: [ [ 'Font', 'FontSize', 'Format', 'Styles' ] ] | ||
} | ||
} | ||
}; | ||
|
||
var tests = { | ||
'test if font combo loads proper stylesheet': function( editor, bot ) { | ||
bot.combo( 'Font', function( combo ) { | ||
assert.isTrue( searchForStylesheet( combo ), 'stylesheet is present in combo\'s iframe' ); | ||
} ); | ||
}, | ||
|
||
'test if font size combo loads proper stylesheet': function( editor, bot ) { | ||
bot.combo( 'FontSize', function( combo ) { | ||
assert.isTrue( searchForStylesheet( combo ), 'stylesheet is present in combo\'s iframe' ); | ||
} ); | ||
}, | ||
|
||
'test if format combo loads proper stylesheet': function( editor, bot ) { | ||
bot.combo( 'Format', function( combo ) { | ||
assert.isTrue( searchForStylesheet( combo ), 'stylesheet is present in combo\'s iframe' ); | ||
} ); | ||
}, | ||
|
||
'test if styles combo loads proper stylesheet': function( editor, bot ) { | ||
bot.combo( 'Styles', function( combo ) { | ||
assert.isTrue( searchForStylesheet( combo ), 'stylesheet is present in combo\'s iframe' ); | ||
} ); | ||
} | ||
}; | ||
|
||
tests = bender.tools.createTestsForEditors( CKEDITOR.tools.objectKeys( bender.editors ), tests ); | ||
|
||
bender.test( tests ); | ||
|
||
function searchForStylesheet( combo ) { | ||
var frameDoc = combo._.panel.element.getFirst().getFrameDocument(); | ||
|
||
// Look for any stylesheet link elems that end with desired CSS file. | ||
return Boolean( frameDoc.findOne( 'link[rel="stylesheet"][href$="contents.css"]' ) ); | ||
} | ||
} )(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<body> | ||
<div id="classic"> | ||
<p>Font Styles</p> | ||
</div> | ||
|
||
<div id="inline" contenteditable="true"> | ||
<p>Font Styles</p> | ||
</div> | ||
|
||
<script> | ||
( function() { | ||
'use strict'; | ||
|
||
var editorConfig = { | ||
toolbar: [ [ 'Font', 'FontSize', 'Format', 'Styles' ] ] | ||
}; | ||
|
||
CKEDITOR.replace( 'classic', editorConfig ); | ||
|
||
CKEDITOR.inline( 'inline', editorConfig ); | ||
} )(); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@bender-tags: tc, 4.5.5, 13771, config, font, format, stylescombo | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: font, format, stylescombo, toolbar, floatingspace, wysiwygarea | ||
|
||
---- | ||
Look at the editor's toolbar. Then: | ||
|
||
1. Open "Font" combo. | ||
* The font used in combo's header should be the same as the one used in editable area. | ||
2. Open "Size" combo. | ||
* The font used in combo's header should be the same as the one used in editable area. | ||
3. Open "Normal" combo. | ||
* The font used in combo's header should be the same as the one used in editable area. | ||
4. Open "Styles" combo. | ||
* The font used in combo's header should be the same as the one used in editable area. | ||
|
||
---- | ||
Click the second "Font styles" text to activate inline editor. Then: | ||
|
||
1. Open "Font" combo. | ||
* The font used in combo's header should be different than the one used in editable area. | ||
2. Open "Size" combo. | ||
* The font used in combo's header should be different than the one used in editable area. | ||
3. Open "Normal" combo. | ||
* The font used in combo's header should be different than the one used in editable area. | ||
4. Open "Styles" combo. | ||
* The font used in combo's header should be different than the one used in editable area. |