minified does not work in the emulator or iOS so move settings iteration to utils.prepareSettingsForAppMessage()

This commit is contained in:
Keegan
2016-03-09 12:24:29 +11:00
parent 34d83de59e
commit 37c64a6e05
4 changed files with 45 additions and 50 deletions
+26
View File
@@ -56,4 +56,30 @@ describe('Utils', function() {
assert.strictEqual(utils.prepareForAppMessage(123), 123);
});
});
describe('.prepareSettingsForAppMessage', function() {
it('converts the settings correctly', function() {
var settings = {
test1: false,
test2: 'val-2',
test3: true,
test4: ['cb-1', 'cb-3'],
test5: 12345,
test6: [1, 2, 3, 4],
test7: [true, false, true]
};
var expected = {
test1: 0,
test2: 'val-2',
test3: 1,
test4: ['cb-1', 0, 'cb-3', 0],
test5: 12345,
test6: [1, 2, 3, 4],
test7: [1, 0, 1]
};
assert.deepEqual(utils.prepareSettingsForAppMessage(settings), expected);
});
});
});