mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-03 15:47:43 -04:00
Merge pull request #17 from pebble/#15/fix-travis-random-fails
#15/fix travis random fails
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -58,10 +58,15 @@ describe('Clay', function() {
|
|||||||
function() {
|
function() {
|
||||||
stubPebble();
|
stubPebble();
|
||||||
var clay = fixture.clay([]);
|
var clay = fixture.clay([]);
|
||||||
|
|
||||||
|
// we stub the generateUrl method to avoid very large string comparisons.
|
||||||
|
var generateUrlStub = sinon.stub(clay, 'generateUrl');
|
||||||
|
generateUrlStub.returns('data:text/html;base64,PGh0bWw%2BVEVTVDwvaHRtbD4%3D');
|
||||||
Pebble.addEventListener.withArgs('showConfiguration').callArg(1);
|
Pebble.addEventListener.withArgs('showConfiguration').callArg(1);
|
||||||
|
|
||||||
assert(Pebble.addEventListener.calledWith('showConfiguration'));
|
assert(Pebble.addEventListener.calledWith('showConfiguration'));
|
||||||
assert(Pebble.openURL.calledWith(clay.generateUrl()));
|
assert(Pebble.openURL.calledWith(clay.generateUrl()));
|
||||||
|
generateUrlStub.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles the "webviewclosed" event if autoHandleEvents is not false',
|
it('handles the "webviewclosed" event if autoHandleEvents is not false',
|
||||||
@@ -117,6 +122,17 @@ describe('Clay', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('.generateUrl()', function() {
|
describe('.generateUrl()', function() {
|
||||||
|
|
||||||
|
// @todo this test becomes redundant with the work in 94428b1
|
||||||
|
it('Replaces $$RETURN_TO$$ if in not in the emulator', function() {
|
||||||
|
var clay = fixture.clay([]);
|
||||||
|
stubPebble();
|
||||||
|
Pebble.platform = 'ios';
|
||||||
|
var decodedUrl =
|
||||||
|
atob(decodeURIComponent(clay.generateUrl().replace(/^.*?,/, '')));
|
||||||
|
assert.match(decodedUrl, /pebblejs:\/\/close#/);
|
||||||
|
});
|
||||||
|
|
||||||
it('does not replace $$RETURN_TO$$ if in the emulator', function() {
|
it('does not replace $$RETURN_TO$$ if in the emulator', function() {
|
||||||
var clay = fixture.clay([]);
|
var clay = fixture.clay([]);
|
||||||
stubPebble();
|
stubPebble();
|
||||||
|
|||||||
Reference in New Issue
Block a user