Merge pull request #17 from pebble/#15/fix-travis-random-fails

#15/fix travis random fails
This commit is contained in:
keegan-lillo
2016-02-27 08:31:20 +11:00
2 changed files with 17 additions and 1 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+16
View File
@@ -58,10 +58,15 @@ describe('Clay', function() {
function() {
stubPebble();
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);
assert(Pebble.addEventListener.calledWith('showConfiguration'));
assert(Pebble.openURL.calledWith(clay.generateUrl()));
generateUrlStub.restore();
});
it('handles the "webviewclosed" event if autoHandleEvents is not false',
@@ -117,6 +122,17 @@ describe('Clay', 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() {
var clay = fixture.clay([]);
stubPebble();