8
0

utils.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals document */
  6. import testUtils from '../../tests/_utils/utils';
  7. describe( 'utils', () => {
  8. describe( 'createTestUIView', () => {
  9. describe( 'view instance', () => {
  10. it( 'comes with a view', () => {
  11. const view = testUtils.createTestUIView();
  12. expect( view.element ).to.equal( document.body );
  13. } );
  14. it( 'creates collections and regions', () => {
  15. const view = testUtils.createTestUIView( {
  16. foo: el => el.firstChild,
  17. bar: el => el.lastChild
  18. } );
  19. expect( view.foo._parentElement ).to.equal( document.body.firstChild );
  20. expect( view.bar._parentElement ).to.equal( document.body.lastChild );
  21. } );
  22. it( 'is rendered', () => {
  23. const view = testUtils.createTestUIView( {
  24. foo: el => el.firstChild,
  25. bar: el => el.lastChild
  26. } );
  27. expect( view.isRendered ).to.be.true;
  28. } );
  29. } );
  30. } );
  31. } );