mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-06 00:57:21 -04:00
Add an extra test to make sure webviewclosed & showConfiguration events are not handled
This commit is contained in:
+9
-2
@@ -64,7 +64,7 @@ describe('Clay', function() {
|
|||||||
assert(Pebble.openURL.calledWith(clay.generateUrl()));
|
assert(Pebble.openURL.calledWith(clay.generateUrl()));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles the "showConfiguration" event if autoHandleEvents is not false',
|
it('handles the "webviewclosed" event if autoHandleEvents is not false',
|
||||||
function() {
|
function() {
|
||||||
stubPebble();
|
stubPebble();
|
||||||
fixture.clay([]);
|
fixture.clay([]);
|
||||||
@@ -94,6 +94,13 @@ describe('Clay', function() {
|
|||||||
assert(Pebble.addEventListener.calledWith('webviewclosed'));
|
assert(Pebble.addEventListener.calledWith('webviewclosed'));
|
||||||
assert.strictEqual(Pebble.sendAppMessage.callCount, 0);
|
assert.strictEqual(Pebble.sendAppMessage.callCount, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not handle the "webviewclosed" or "showConfiguration" events ' +
|
||||||
|
'if autoHandleEvents is false', function() {
|
||||||
|
stubPebble();
|
||||||
|
fixture.clay([], null, { autoHandleEvents: false });
|
||||||
|
assert.strictEqual(Pebble.addEventListener.called, false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('.registerComponent()', function() {
|
describe('.registerComponent()', function() {
|
||||||
@@ -129,7 +136,7 @@ describe('Clay', function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('doesn\'t thow and logs an error if setting in localStorage are broken',
|
it('doesn\'t throw and logs an error if settings in localStorage are broken',
|
||||||
function() {
|
function() {
|
||||||
var clay = fixture.clay([]);
|
var clay = fixture.clay([]);
|
||||||
var errorStub = sinon.stub(console, 'error');
|
var errorStub = sinon.stub(console, 'error');
|
||||||
|
|||||||
Reference in New Issue
Block a user