resize.js 444 B

12345678910111213141516
  1. QUnit.test( 'resize', function( assert ) {
  2. 'use strict';
  3. var elem = document.querySelector('#resize');
  4. var flkty = new Flickity( elem, {
  5. initialIndex: 2
  6. });
  7. elem.style.width = '500px';
  8. flkty.resize();
  9. assert.equal( flkty.selectedIndex, 2, 'selectedIndex = 2' );
  10. assert.equal( flkty.cursorPosition, 250, 'cursorPosition = 250' );
  11. assert.equal( flkty.x + flkty.cursorPosition, -1000, 'x + cursorPosition = -1000' );
  12. });