get-wrap-cells.js 896 B

123456789101112131415161718192021222324
  1. QUnit.test( 'getWrapCells', function( assert ) {
  2. 'use strict';
  3. var flkty = new Flickity( '#get-wrap-cells', {
  4. wrapAround: true
  5. });
  6. // cells are 25% width
  7. // center align, 2 cells on each side
  8. assert.equal( flkty.beforeShiftCells.length, 2, 'center align, 2 before shift cells' );
  9. assert.equal( flkty.afterShiftCells.length, 2, 'center align, 2 after shift cells' );
  10. flkty.options.cellAlign = 'left';
  11. flkty.resize();
  12. // left align, 0, 4
  13. assert.equal( flkty.beforeShiftCells.length, 0, 'left align, 1 before shift cells' );
  14. assert.equal( flkty.afterShiftCells.length, 4, 'left align, 4 after shift cells' );
  15. flkty.options.cellAlign = 'right';
  16. flkty.resize();
  17. // right align, 4, 0
  18. assert.equal( flkty.beforeShiftCells.length, 4, 'right align, 4 before shift cells' );
  19. assert.equal( flkty.afterShiftCells.length, 0, 'right align, 0 after shift cells' );
  20. });