mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #636 - rename all application-settings things to preferences-settings
The name is not ideal, but it's better to have a MiscPreferencesController than a MainApplicationController for this kind of very simple panels.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(typeof exports != "undefined" ? exports : pskl_exports).tests = [
|
||||
'palettes/test-tiny-palettes.js',
|
||||
'settings/test-application-main.js',
|
||||
'settings/test-preferences-main.js',
|
||||
'settings/test-export-gif.js',
|
||||
'settings/test-export-gif-scale.js',
|
||||
'settings/test-export-gif-simple.js',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* globals casper, setPiskelFromGrid, isDrawerExpanded, getValue, isChecked,
|
||||
evalLine, waitForEvent, piskelFrameEqualsGrid, replaceFunction, setPiskelFromImageSrc */
|
||||
|
||||
casper.test.begin('Application main settings test', 11, function(test) {
|
||||
casper.test.begin('Preferences settings panel test', 11, function(test) {
|
||||
test.timeout = test.fail.bind(test, ['Test timed out']);
|
||||
|
||||
function onTestStart() {
|
||||
@@ -9,22 +9,22 @@ casper.test.begin('Application main settings test', 11, function(test) {
|
||||
|
||||
test.assert(!isDrawerExpanded(), 'settings drawer is closed');
|
||||
|
||||
// Open application/user/preferences panel.
|
||||
test.assertDoesntExist('.expanded .settings-section-application', 'Check if application panel is closed');
|
||||
// Open preferences panel.
|
||||
test.assertDoesntExist('.expanded .settings-section-preferences', 'Check if preferences panel is closed');
|
||||
casper.click('[data-setting="user"]');
|
||||
|
||||
casper.waitForSelector('.expanded .settings-section-application', onApplicationPanelReady, test.timeout, 10000);
|
||||
casper.waitForSelector('.expanded .settings-section-preferences', onPreferencesPanelReady, test.timeout, 10000);
|
||||
}
|
||||
|
||||
function onApplicationPanelReady() {
|
||||
casper.echo('Application panel ready');
|
||||
function onPreferencesPanelReady() {
|
||||
casper.echo('Preferences panel ready');
|
||||
|
||||
test.assert(isDrawerExpanded(), 'settings drawer is expanded');
|
||||
test.assertExists('.expanded .settings-section-application',
|
||||
'Check if application panel is opened');
|
||||
test.assertExists('.expanded .settings-section-preferences',
|
||||
'Check if preferences panel is opened');
|
||||
|
||||
test.assertExists('.application-panel-main', 'Check if main tab is rendered');
|
||||
test.assertDoesntExist('.application-panel-grid', 'Check that grid tab is not rendered');
|
||||
test.assertExists('.preferences-panel-misc', 'Check if misc tab is rendered');
|
||||
test.assertDoesntExist('.preferences-panel-grid', 'Check that grid tab is not rendered');
|
||||
casper.click('[data-tab-id="grid"]');
|
||||
casper.waitForSelector('[data-tab-id="grid"]', onGridTabSelected, test.timeout, 10000);
|
||||
}
|
||||
@@ -32,7 +32,7 @@ casper.test.begin('Application main settings test', 11, function(test) {
|
||||
function onGridTabSelected() {
|
||||
casper.echo('Grid tab ready');
|
||||
|
||||
test.assertDoesntExist('.application-panel-tile', 'Check that tile tab is not rendered');
|
||||
test.assertDoesntExist('.preferences-panel-tile', 'Check that tile tab is not rendered');
|
||||
casper.click('[data-tab-id="tile"]');
|
||||
casper.waitForSelector('[data-tab-id="tile"]', onTileTabSelected, test.timeout, 10000);
|
||||
}
|
||||
@@ -49,12 +49,12 @@ casper.test.begin('Application main settings test', 11, function(test) {
|
||||
test.assert(!isDrawerExpanded(), 'settings drawer is closed');
|
||||
// Open the settings again to check if the last tab is selected.
|
||||
casper.click('[data-setting="user"]');
|
||||
casper.waitForSelector('.expanded .settings-section-application', onApplicationPanelExpandedAgain, test.timeout, 10000);
|
||||
casper.waitForSelector('.expanded .settings-section-preferences', onPreferencesPanelExpandedAgain, test.timeout, 10000);
|
||||
}
|
||||
|
||||
function onApplicationPanelExpandedAgain() {
|
||||
function onPreferencesPanelExpandedAgain() {
|
||||
casper.echo('Tile tab ready');
|
||||
test.assertExists('.application-panel-tile', 'Check if tile tab is selected');
|
||||
test.assertExists('.preferences-panel-tile', 'Check if tile tab is selected');
|
||||
|
||||
// Close the panel a second time.
|
||||
casper.click('[data-setting="user"]');
|
||||
@@ -18,16 +18,16 @@ casper.test.begin('Settings Test', 18, function(test) {
|
||||
test.assert(isDrawerExpanded(), 'settings drawer is expanded');
|
||||
test.assertExists('.settings-section-resize', 'Check if resize panel is opened');
|
||||
|
||||
// Open application settings panel.
|
||||
test.assertDoesntExist('.settings-section-application', 'Check if application settings panel is closed');
|
||||
// Open preferences settings panel.
|
||||
test.assertDoesntExist('.settings-section-preferences', 'Check if preferences settings panel is closed');
|
||||
this.click('[data-setting="user"]');
|
||||
|
||||
this.waitForSelector('.settings-section-application', onApplicationPanelReady, test.timeout, 10000);
|
||||
this.waitForSelector('.settings-section-preferences', onPreferencesPanelReady, test.timeout, 10000);
|
||||
}
|
||||
|
||||
function onApplicationPanelReady() {
|
||||
function onPreferencesPanelReady() {
|
||||
test.assert(isDrawerExpanded(), 'settings drawer is expanded');
|
||||
test.assertExists('.settings-section-application', 'Check if application settings panel is opened');
|
||||
test.assertExists('.settings-section-preferences', 'Check if preferences settings panel is opened');
|
||||
|
||||
// Open save panel.
|
||||
test.assertDoesntExist('.settings-section-save', 'Check if save panel is closed');
|
||||
|
||||
Reference in New Issue
Block a user