Skip to content

Commit

Permalink
Tests for deleting profile, and downgrading Intern to 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarykluczynski committed May 18, 2015
1 parent eb90645 commit fe93f7e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Expand Up @@ -13,15 +13,15 @@ module.exports = function (grunt) {
options: {
runType: "client",
config: "tests/intern",
reporters: [ "combined" ]
reporters: [ "Combined" ]
}
},
/** Local functional tests config. */
runner: {
options: {
runType: "runner",
config: "tests/intern",
reporters: [ "combined" ]
reporters: [ "Combined" ]
}
},
/** CI unit tests config. */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -31,7 +31,7 @@
"test": "grunt test"
},
"devDependencies": {
"intern": "theintern/intern#master",
"intern": "2.2.2",
"grunt": "~0.4.5",
"grunt-coveralls": "^1.0.0"
}
Expand Down
3 changes: 3 additions & 0 deletions src/qunit-desktop-notifications.js
Expand Up @@ -598,6 +598,9 @@ QUnitDesktopNotifications.profiles.new = function () {

/** Deleting selected profile. */
QUnitDesktopNotifications.profiles.delete = function () {
var profileName = this.selectedProfileName();
this.profile( profileName, null );
this.refreshVisible();
};

/** In case QUnit was not found, generate error and don't initialize desktop notifications. */
Expand Down
17 changes: 14 additions & 3 deletions tests/functional/delete.js
Expand Up @@ -27,10 +27,21 @@ define([
.click()
.end()
.end()
/** Assert that the "silent" profile can be deleted, and delete it. */
.findByCssSelector( "button[action=\"delete\"]" )
.isEnabled()
.then( function ( enabled ) {
assert.ok( enabled, "Delete button is enable when \"default\" profile is not selected." );
.isEnabled()
.then( function ( enabled ) {
assert.ok( enabled, "Delete button is enable when \"default\" profile is not selected." );
})
.click()
.end()
/** Assert that the "silent" profile was deleted. */
.waitForDeletedByCssSelector( "select option[name=\"silent\"]" )
.execute( function () {
return QUnitDesktopNotifications.utils.localStorage( "silent" );
})
.then( function ( silent ) {
assert.equal( silent, null, "Item was deleted from local storage." );
});
},

Expand Down

0 comments on commit fe93f7e

Please sign in to comment.