mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
add resize test checking frame content
Moved shared methods to a head.js file
This commit is contained in:

committed by
juliandescottes

parent
569b508fd5
commit
a328e4d20e
@ -1,18 +1,5 @@
|
||||
casper.test.begin('Test updating default size works', 14 , function(test) {
|
||||
test.timeout = test.fail.bind(test, ['Test timed out']);
|
||||
function getValue(selector) {
|
||||
return casper.evaluate(
|
||||
'function () { \
|
||||
return document.querySelector(\'' + selector + '\').value;\
|
||||
}');
|
||||
};
|
||||
|
||||
function isDrawerExpanded() {
|
||||
return casper.evaluate(function () {
|
||||
var settingsElement = document.querySelector('[data-pskl-controller="settings"]');
|
||||
return settingsElement.classList.contains('expanded');
|
||||
});
|
||||
}
|
||||
|
||||
function onTestStart() {
|
||||
test.assertExists('#drawing-canvas-container canvas', 'Piskel ready, test starting');
|
||||
@ -53,13 +40,11 @@ casper.test.begin('Test updating default size works', 14 , function(test) {
|
||||
function onDrawerClosed() {
|
||||
test.assert(!isDrawerExpanded(), 'settings drawer is closed');
|
||||
|
||||
test.assertEquals(casper.evaluate(function () {
|
||||
return pskl.UserSettings.get('DEFAULT_SIZE').width;
|
||||
}), 321, 'Piskel width is now 321 pixels');
|
||||
test.assertEquals(evalLine('pskl.UserSettings.get("DEFAULT_SIZE").width'),
|
||||
321, 'Piskel width is now 321 pixels');
|
||||
|
||||
test.assertEquals(casper.evaluate(function () {
|
||||
return pskl.UserSettings.get('DEFAULT_SIZE').height;
|
||||
}), 322, 'Piskel default height is now 322 pixels');
|
||||
test.assertEquals(evalLine('pskl.UserSettings.get("DEFAULT_SIZE").height'),
|
||||
322, 'Piskel height is now 322 pixels');
|
||||
}
|
||||
|
||||
casper
|
||||
|
Reference in New Issue
Block a user