Skip to content

Commit

Permalink
Update tests to use the new viewport offset config
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidurbanski committed Aug 13, 2021
1 parent f117389 commit d114b6b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/ckeditor5-build-classic/tests/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ describe( 'ClassicEditor build', () => {
it( 'allows configuring toolbar offset without overriding toolbar items', () => {
return ClassicEditor
.create( editorElement, {
toolbar: {
viewportTopOffset: 42
ui: {
viewportOffset: {
top: 42
}
}
} )
.then( newEditor => {
Expand Down
4 changes: 3 additions & 1 deletion packages/ckeditor5-editor-classic/tests/classiceditorui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals document, Event */
/* globals document, Event, console */

import View from '@ckeditor/ckeditor5-ui/src/view';

Expand Down Expand Up @@ -86,6 +86,8 @@ describe( 'ClassicEditorUI', () => {
} );

it( 'sets view.stickyPanel#viewportTopOffset, if legacy toolbar.vierportTopOffset specified', () => {
sinon.stub( console, 'warn' );

return VirtualClassicTestEditor
.create( 'foo', {
toolbar: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ describe( 'DecoupledEditorUI', () => {
return VirtualDecoupledTestEditor
.create( '', {
toolbar: {
items: [ 'foo', 'bar' ],
viewportTopOffset: 100
items: [ 'foo', 'bar' ]
},
ui: {
viewportOffset: {
top: 100
}
}
} )
.then( editor => {
Expand Down
4 changes: 3 additions & 1 deletion packages/ckeditor5-editor-inline/tests/inlineeditorui.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals document, Event */
/* globals document, Event, console */

import View from '@ckeditor/ckeditor5-ui/src/view';

Expand Down Expand Up @@ -85,6 +85,8 @@ describe( 'InlineEditorUI', () => {
} );

it( 'sets view#viewportTopOffset, if legacy toolbar.vierportTopOffset specified', () => {
sinon.stub( console, 'warn' );

return VirtualInlineTestEditor
.create( 'foo', {
toolbar: {
Expand Down

0 comments on commit d114b6b

Please sign in to comment.