topx.js 567 B

123456789101112131415161718192021
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: dom */
  6. import toPx from '/ckeditor5/utils/dom/topx.js';
  7. describe( 'toPx', () => {
  8. it( 'should be a function', () => {
  9. expect( toPx ).to.be.a( 'function' );
  10. } );
  11. it( 'should always pixelize the value', () => {
  12. expect( toPx( null ) ).to.equal( 'nullpx' );
  13. expect( toPx( undefined ) ).to.equal( 'undefinedpx' );
  14. expect( toPx( '10' ) ).to.equal( '10px' );
  15. expect( toPx( 10 ) ).to.equal( '10px' );
  16. } );
  17. } );