Skip to content

Commit

Permalink
test(lory): update tests to work in all browsers correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Heinz committed Oct 19, 2015
1 parent fcc01ec commit 6347909
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
12 changes: 5 additions & 7 deletions local.karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ module.exports = function (config) {
],

browsers: [
'Chrome'
// 'ChromeCanary',
// 'PhantomJS',
// 'Firefox',
// 'Opera',
// 'Safari'
'Chrome',
'ChromeCanary',
'PhantomJS',
'Firefox',
'Safari'
],

plugins: [
Expand All @@ -39,7 +38,6 @@ module.exports = function (config) {
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-ie-launcher',
'karma-opera-launcher',
'karma-firefox-launcher',
'karma-safari-launcher',
'karma-html2js-preprocessor'
Expand Down
35 changes: 9 additions & 26 deletions test/lory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ describe('.next() called 2x', function() {
instance.next();
}

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 2);
});
});

Expand All @@ -194,10 +191,7 @@ describe('.next() called 4x', function() {
instance.next();
}

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 4);
});
});

Expand Down Expand Up @@ -251,10 +245,7 @@ describe('.prev() called 2x without infinite', function() {
instance.prev();
}

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 0);
});
});

Expand All @@ -280,10 +271,7 @@ describe('.prev() called 4x without infinite', function() {
instance.prev();
}

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 0);
});
});

Expand All @@ -310,13 +298,11 @@ describe('.prev() called 2x with infinite', function() {
});

it('offset has to be the expectedOffset', function() {
instance.prev();
instance.prev();

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41
for (var i = 0; i < 2; i++) {
instance.prev();
}

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 5);
});
});

Expand Down Expand Up @@ -347,10 +333,7 @@ describe('.prev() called 4x with infinite', function() {
instance.prev();
}

var transform = document.querySelector('.js_slides').style.transform
var offset = new WebKitCSSMatrix(document.querySelector('.js_slides').style.transform).m41

assert.equal(offset, expectedOffset);
assert.equal(instance.returnIndex(), 3);
});
});

Expand Down

0 comments on commit 6347909

Please sign in to comment.