Skip to content

Commit

Permalink
Include #2470 in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer committed Feb 19, 2019
1 parent f5694fb commit 1833554
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/plugins/copyformatting/applyformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
assert.areSame( tableConstant, determineContext(), 'Selection within two rows' );
},

// (#2655)
// (#2655, #2470)
'test applyFormat not fired without copied styles': function() {
var editor = this.editor,
spy = sinon.spy( editor, 'execCommand' ),
Expand Down
27 changes: 23 additions & 4 deletions tests/plugins/copyformatting/manual/nestededitablefocus.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<style>
#square {
margin-top: 20px;
width: 100px;
height: 100px;
border: 1px #000 solid;
background-color: red;
}
</style>
<h2>Classic editor</h2>
<div id="classic">
<div class="test1">x<div class="content">Widget1</div>y</div>
</div>

<script>
if ( !CKEDITOR.env.webkit ) {
bender.ignore();
}
<div id="square"></div>

<script>
CKEDITOR.addCss( '.cke_editable { margin: 0;padding: 50px; }' +
'.test1 { border: 1px #000 solid; }' );
CKEDITOR.replace( 'classic', {
Expand Down Expand Up @@ -38,7 +45,19 @@ <h2>Classic editor</h2>

upcast: function( element ) {
return element.name == 'div' && element.hasClass( 'test1' );
},

init: function() {
var square = CKEDITOR.document.getById( 'square' );

this.editables.content.on( 'focus', function() {
square.setStyle( 'background-color', 'green' );
} );
this.editables.content.on( 'blur', function() {
square.setStyle( 'background-color', 'red' );
} );
}

} );
}
} );
Expand Down
8 changes: 5 additions & 3 deletions tests/plugins/copyformatting/manual/nestededitablefocus.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@bender-tags: bug, 4.11.3, 2655
@bender-tags: bug, 4.11.3, 2655, 2470
@bender-ui: collapsed
@bender-ckeditor-plugins: widget, wysiwygarea, copyformatting

Expand All @@ -8,8 +8,10 @@

## Expected

Focus is moved into nested editable and stays there.
* Focus is moved into nested editable and stays there.
* Square under the editor is green.

## Unexpected

Focus is moved into nested editable for a fraction of second and then disappears.
* Focus is moved into nested editable for a fraction of second and then disappears.
* Square under the editor is red.

0 comments on commit 1833554

Please sign in to comment.