-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcordova-geolocation-background-tests.js
57 lines (55 loc) · 2.25 KB
/
cordova-geolocation-background-tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Tinytest.add('background-init', function (test) {
// test: cordova exists
// test: plugin exists
// test: plugin methods correct (API expected)
test.equal(true, true);
test.equal(typeof GeolocationBG, 'object', 'We do not have GeolocationBG defined');
test.equal(GeolocationBG.hasWorked, false, 'GeolocationBG shows that is has worked in the past... but should not have yet');
//test.assertTrue(GeolocationBG);
//test.assertTrue(_.isOjbect(GeolocationBG));
});
if (Meteor.isCordova) {
Tinytest.add('background-avail', function (test) {
// test: plugin available
test.equal(GeolocationBG.avail(), true, 'GeolocationBG.avail() is false');
});
Tinytest.add('background-config', function (test) {
// test: plugin available
var config = GeolocationBG.config();
test.equal(_.isObject(config), true, 'GeolocationBG.config() should return the default configuration');
var after = GeolocationBG.config({
url: 'http://example.com/foobar',
newProp: 'foobar'
});
var expect = config;
expect.url = 'http://example.com/foobar';
expect.newProp = 'foobar';
test.equal(after, expect, 'GeolocationBG.config() should setup the after copy of the config, with the expected changes');
});
Tinytest.add('background-start', function (test) {
test.equal(GeolocationBG.start(), true, 'GeolocationBG.start() is false');
});
Tinytest.add('background-stop', function (test) {
test.equal(GeolocationBG.stop(), true, 'GeolocationBG.stop() is false');
});
Tinytest.add('background-setup', function (test) {
test.equal(GeolocationBG.setup(), true, 'GeolocationBG.setup() is false');
});
Tinytest.add('background-send', function (test) {
//test.equal(GeolocationBG.send(location), true, 'GeolocationBG.send() is false');
});
Tinytest.add('background-sendCallback', function (test) {
//test.equal(GeolocationBG.sendCallback(response), true, 'GeolocationBG.sendCallback() is false');
});
// -----------
// todo
// -----------
Tinytest.add('background-android', function (test) {
// test: location requested in background - android
test.equal(true, true);
});
Tinytest.add('background-ios', function (test) {
// test: location requested in background - ios
test.equal(true, true);
});
}