Build mobile apps with simple HTML, CSS, and JS components. http://goratchet.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
921 B

10 years ago
describe('Slider', function () {
var slider = null;
beforeEach(function () {
var templateSlider = [
'<div class="slider" id="mySlider">',
'<div id="mySlider" class="slide-group">',
'<div id="firstSlide" class="slide">',
'<img src="http://goratchet.com/assets/img/slide-2.jpg">',
'</div>',
'<div class="slide">',
'<img src="http://goratchet.com/assets/img/slide-3.jpg">',
'</div>',
'</div>',
'</div>'
].join('');
document.body.innerHTML += templateSlider;
slider = document.getElementById('mySlider');
});
afterEach(function () {
slider.parentNode.removeChild(slider);
slider = null;
});
it('Slider should fire slide event', function (done) {
slider.addEventListener('slide', function () {
expect(true).toBe(true);
done();
});
TouchFaker.fakeEvent('touchstart', '#firstSlide');
});
});