listview.js 834 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import ViewCollection from '../../src/viewcollection';
  6. import ListView from '../../src/list/listview';
  7. describe( 'ListView', () => {
  8. let view;
  9. beforeEach( () => {
  10. return ( view = new ListView() ).init();
  11. } );
  12. describe( 'constructor()', () => {
  13. it( 'creates element from template', () => {
  14. expect( view.element.classList.contains( 'ck-reset' ) ).to.be.true;
  15. expect( view.element.classList.contains( 'ck-list' ) ).to.be.true;
  16. } );
  17. it( 'creates view#children collection', () => {
  18. expect( view.items ).to.be.instanceOf( ViewCollection );
  19. expect( view.template.children ).to.have.length( 1 );
  20. expect( view.template.children.get( 0 ) ).to.equal( view.items );
  21. } );
  22. } );
  23. } );