Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18613 from mcav/delete-alarm
Browse files Browse the repository at this point in the history
Bug 1000496 - [B2G][Clock]Deleting an alarm then killing the clock app a... r=millermedeiros
  • Loading branch information
mcav committed Apr 25, 2014
2 parents 0d07467 + 4e74f11 commit acde8c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/clock/js/alarm.js
Expand Up @@ -293,7 +293,7 @@ define(function(require, exports, module) {
window.dispatchEvent(new CustomEvent('alarm-removed', {
detail: { alarm: this }
}));
callback(err, this);
callback && callback(err, this);
});
},

Expand Down
8 changes: 8 additions & 0 deletions apps/clock/test/marionette/alarm_test.js
Expand Up @@ -21,6 +21,14 @@ marionette('Alarm', function() {
assert.ok($('#clock-day-date').displayed());
});

test('Deleting an alarm works between app launches', function() {
alarm.create();
alarm.openEditForm(0);
alarm.delete();
actions.restart();
assert.equal(alarm.list.length, 0);
});

// PythonTests: functional/test_clock_set_alarm
test('Blank "New Alarm" form mutates properly', function() {
alarm.openNewForm();
Expand Down
4 changes: 4 additions & 0 deletions apps/clock/test/marionette/lib/alarm_actions.js
Expand Up @@ -63,6 +63,10 @@ AlarmActions.prototype = {
this.actions.tapAndTransition('#alarm-close');
},

delete: function() {
this.actions.tapAndTransition('#alarm-delete');
},

saveForm: function() {
this.actions.tapAndTransition('#alarm-done');
},
Expand Down

0 comments on commit acde8c6

Please sign in to comment.