videomail-client 8.3.0 → 8.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/prototype/js/videomail-client.js +12 -15
- package/prototype/js/videomail-client.min.js +1 -1
- package/prototype/js/videomail-client.min.js.map +1 -1
- package/videomail-client.code-workspace +25 -0
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -46
- package/.nvmrc +0 -1
- package/.prettierignore +0 -1
- package/.travis.yml +0 -14
- package/audit-ci.json +0 -12
- package/babel.config.js +0 -38
- package/browserstack.png +0 -0
- package/env/dev/cert.pem +0 -26
- package/env/dev/key.pem +0 -28
- package/env/dev/release.sh +0 -96
- package/gulpfile.js +0 -241
- package/prettier.config.js +0 -8
- package/src/js/client.js +0 -210
- package/src/js/constants.js +0 -11
- package/src/js/events.js +0 -46
- package/src/js/index.js +0 -15
- package/src/js/options.js +0 -180
- package/src/js/resource.js +0 -206
- package/src/js/util/audioRecorder.js +0 -152
- package/src/js/util/browser.js +0 -319
- package/src/js/util/collectLogger.js +0 -72
- package/src/js/util/eventEmitter.js +0 -72
- package/src/js/util/humanize.js +0 -16
- package/src/js/util/mediaEvents.js +0 -148
- package/src/js/util/pretty.js +0 -70
- package/src/js/util/standardize.js +0 -71
- package/src/js/util/videomailError.js +0 -431
- package/src/js/wrappers/buttons.js +0 -670
- package/src/js/wrappers/container.js +0 -797
- package/src/js/wrappers/dimension.js +0 -149
- package/src/js/wrappers/form.js +0 -319
- package/src/js/wrappers/optionsWrapper.js +0 -81
- package/src/js/wrappers/visuals/inside/recorder/countdown.js +0 -83
- package/src/js/wrappers/visuals/inside/recorder/facingMode.js +0 -53
- package/src/js/wrappers/visuals/inside/recorder/pausedNote.js +0 -59
- package/src/js/wrappers/visuals/inside/recorder/recordNote.js +0 -42
- package/src/js/wrappers/visuals/inside/recorder/recordTimer.js +0 -149
- package/src/js/wrappers/visuals/inside/recorderInsides.js +0 -144
- package/src/js/wrappers/visuals/notifier.js +0 -341
- package/src/js/wrappers/visuals/recorder.js +0 -1492
- package/src/js/wrappers/visuals/replay.js +0 -355
- package/src/js/wrappers/visuals/userMedia.js +0 -541
- package/src/js/wrappers/visuals.js +0 -410
- package/src/styles/css/main.min.css.js +0 -1
- package/src/styles/styl/keyframes/blink.styl +0 -16
- package/src/styles/styl/main.styl +0 -126
- package/test/core/client.test.js +0 -64
- package/test/core/resource.test.js +0 -12
- package/test/util/audioRecorder.test.js +0 -13
- package/test/util/browser.test.js +0 -157
- package/test/util/collectLogger.test.js +0 -13
- package/test/util/eventEmitter.test.js +0 -13
- package/test/util/humanize.test.js +0 -21
- package/test/util/pretty.test.js +0 -116
- package/test/util/videomailError.test.js +0 -323
- package/test/wrappers/buttons.test.js +0 -15
- package/test/wrappers/container.test.js +0 -18
- package/test/wrappers/form.test.js +0 -13
- package/test/wrappers/notifier.test.js +0 -13
- package/test/wrappers/recorder.test.js +0 -18
- package/test/wrappers/replay.test.js +0 -15
- package/test/wrappers/userMedia.test.js +0 -13
- package/test/wrappers/visuals.test.js +0 -18
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Browser from "../../src/js/util/browser";
|
|
4
|
-
|
|
5
|
-
test("Browser:", { timeout: 2000 }, function (t) {
|
|
6
|
-
t.test("without arguments", function (tt) {
|
|
7
|
-
tt.plan(7);
|
|
8
|
-
|
|
9
|
-
const browser = new Browser({ debug() {} });
|
|
10
|
-
|
|
11
|
-
let err = browser.checkBufferTypes();
|
|
12
|
-
tt.equal(err, undefined);
|
|
13
|
-
|
|
14
|
-
const videoType = browser.getVideoType();
|
|
15
|
-
tt.equal(videoType, "mp4");
|
|
16
|
-
|
|
17
|
-
err = browser.getNoAccessIssue();
|
|
18
|
-
tt.equal(err.message, "Unable to access webcam");
|
|
19
|
-
tt.equal(
|
|
20
|
-
err.explanation,
|
|
21
|
-
"Your system does not let your browser access your webcam.",
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
tt.equal(browser.isChromeBased(), false);
|
|
25
|
-
tt.equal(browser.isFirefox(), false);
|
|
26
|
-
tt.equal(browser.isEdge(), false);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
t.test("fake old Firefox", function (tt) {
|
|
30
|
-
tt.plan(7);
|
|
31
|
-
|
|
32
|
-
const options = {
|
|
33
|
-
fakeUaString:
|
|
34
|
-
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20131011 Firefox/23.0",
|
|
35
|
-
debug() {},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const browser = new Browser(options);
|
|
39
|
-
let err = browser.checkBufferTypes();
|
|
40
|
-
tt.equal(err, undefined);
|
|
41
|
-
|
|
42
|
-
tt.equal(browser.getVideoType(), "mp4");
|
|
43
|
-
|
|
44
|
-
err = browser.getNoAccessIssue();
|
|
45
|
-
tt.equal(err.message, "Unable to access webcam");
|
|
46
|
-
tt.equal(err.explanation, "Please grant Firefox access to your webcam.");
|
|
47
|
-
|
|
48
|
-
tt.equal(browser.isChromeBased(), false);
|
|
49
|
-
tt.equal(browser.isFirefox(), true);
|
|
50
|
-
tt.equal(browser.isEdge(), false);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
t.test("fake old Chrome", function (tt) {
|
|
54
|
-
tt.plan(7);
|
|
55
|
-
|
|
56
|
-
const options = {
|
|
57
|
-
fakeUaString:
|
|
58
|
-
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.940.0 Safari/535.8",
|
|
59
|
-
debug() {},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const browser = new Browser(options);
|
|
63
|
-
let err = browser.checkBufferTypes();
|
|
64
|
-
tt.equal(err, undefined);
|
|
65
|
-
|
|
66
|
-
tt.equal(browser.getVideoType(), "mp4");
|
|
67
|
-
|
|
68
|
-
err = browser.getNoAccessIssue();
|
|
69
|
-
tt.equal(err.message, "Unable to access webcam");
|
|
70
|
-
tt.equal(
|
|
71
|
-
err.explanation,
|
|
72
|
-
"Click on the allow button to grant access to your webcam.",
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
tt.equal(browser.isChromeBased(), true);
|
|
76
|
-
tt.equal(browser.isFirefox(), false);
|
|
77
|
-
tt.equal(browser.isEdge(), false);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
t.test("fake old IE", function (tt) {
|
|
81
|
-
tt.plan(9);
|
|
82
|
-
|
|
83
|
-
const options = {
|
|
84
|
-
fakeUaString:
|
|
85
|
-
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; Media Center PC 4.0; SLCC1; .NET CLR 3.0.04320)",
|
|
86
|
-
fakeHttps: true,
|
|
87
|
-
debug() {},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const browser = new Browser(options);
|
|
91
|
-
let err = browser.checkRecordingCapabilities();
|
|
92
|
-
tt.equal(err.message, "Sorry, your browser is unable to use webcams");
|
|
93
|
-
tt.ok(
|
|
94
|
-
err.explanation.indexOf("Instead of Internet Explorer you need to upgrade") >= 0,
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
err = browser.checkBufferTypes();
|
|
98
|
-
tt.equal(err, undefined);
|
|
99
|
-
|
|
100
|
-
tt.equal(browser.getVideoType(), "mp4");
|
|
101
|
-
|
|
102
|
-
err = browser.getNoAccessIssue();
|
|
103
|
-
tt.equal(err.message, "Unable to access webcam");
|
|
104
|
-
tt.equal(
|
|
105
|
-
err.explanation,
|
|
106
|
-
"Your system does not let your browser access your webcam.",
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
tt.equal(browser.isChromeBased(), false);
|
|
110
|
-
tt.equal(browser.isFirefox(), false);
|
|
111
|
-
tt.equal(browser.isEdge(), false);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
t.test("fake old Safari", function (tt) {
|
|
115
|
-
tt.plan(7);
|
|
116
|
-
|
|
117
|
-
const options = {
|
|
118
|
-
fakeUaString:
|
|
119
|
-
"Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/532.0+ (KHTML, like Gecko) Version/4.0.3 Safari/531.9",
|
|
120
|
-
fakeHttps: true,
|
|
121
|
-
debug() {},
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const browser = new Browser(options);
|
|
125
|
-
let err = browser.checkBufferTypes();
|
|
126
|
-
tt.equal(err, undefined);
|
|
127
|
-
|
|
128
|
-
tt.equal(browser.getVideoType(), "mp4");
|
|
129
|
-
|
|
130
|
-
err = browser.getNoAccessIssue();
|
|
131
|
-
tt.equal(err.message, "Unable to access webcam");
|
|
132
|
-
tt.equal(
|
|
133
|
-
err.explanation,
|
|
134
|
-
"Your system does not let your browser access your webcam.",
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
tt.equal(browser.isChromeBased(), false);
|
|
138
|
-
tt.equal(browser.isFirefox(), false);
|
|
139
|
-
tt.equal(browser.isEdge(), false);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
t.test("is edge", function (tt) {
|
|
143
|
-
tt.plan(3);
|
|
144
|
-
|
|
145
|
-
const options = {
|
|
146
|
-
fakeUaString:
|
|
147
|
-
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10136",
|
|
148
|
-
debug() {},
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
const browser = new Browser(options);
|
|
152
|
-
|
|
153
|
-
tt.equal(browser.isChromeBased(), false);
|
|
154
|
-
tt.equal(browser.isFirefox(), false);
|
|
155
|
-
tt.equal(browser.isEdge(), true);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import CollectLogger from "./../../src/js/util/collectLogger";
|
|
4
|
-
|
|
5
|
-
test("CollectLogger:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new CollectLogger();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import EventEmitter from "./../../src/js/util/eventEmitter";
|
|
4
|
-
|
|
5
|
-
test("EventEmitter:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new EventEmitter();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import humanize from "./../../src/js/util/humanize";
|
|
4
|
-
|
|
5
|
-
test("humanize:", function (t) {
|
|
6
|
-
t.test("filesize throws error on missing params", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.throws(function () {
|
|
10
|
-
humanize.filesize();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
t.test("toTime can be called", function (tt) {
|
|
15
|
-
tt.plan(1);
|
|
16
|
-
|
|
17
|
-
tt.doesNotThrow(function () {
|
|
18
|
-
humanize.toTime();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
});
|
package/test/util/pretty.test.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import pretty from "./../../src/js/util/pretty";
|
|
4
|
-
|
|
5
|
-
test("pretty:", function (t) {
|
|
6
|
-
t.test("prettifies undefined fine", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.equal(pretty(), "undefined");
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
t.test("prettifies null fine", function (tt) {
|
|
13
|
-
tt.plan(1);
|
|
14
|
-
|
|
15
|
-
tt.equal(pretty(null), "null");
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
t.test("prettifies a string fine", function (tt) {
|
|
19
|
-
tt.plan(1);
|
|
20
|
-
|
|
21
|
-
tt.equal(pretty("sorry"), "sorry");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
t.test("prettifies a true boolean fine", function (tt) {
|
|
25
|
-
tt.plan(1);
|
|
26
|
-
|
|
27
|
-
tt.equal(pretty(true), "true");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
t.test("prettifies a false boolean fine", function (tt) {
|
|
31
|
-
tt.plan(1);
|
|
32
|
-
|
|
33
|
-
tt.equal(pretty(false), "false");
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
t.test("prettifies an object fine", function (tt) {
|
|
37
|
-
tt.plan(1);
|
|
38
|
-
|
|
39
|
-
tt.equal(
|
|
40
|
-
pretty({
|
|
41
|
-
i: "am",
|
|
42
|
-
just: "another",
|
|
43
|
-
stupid: "object",
|
|
44
|
-
empty: "",
|
|
45
|
-
2: 3,
|
|
46
|
-
4: null,
|
|
47
|
-
}),
|
|
48
|
-
'- 3<br/>- "am"<br/>- "another"<br/>- "object"',
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
t.test("prettifies an array fine", function (tt) {
|
|
53
|
-
tt.plan(1);
|
|
54
|
-
|
|
55
|
-
tt.equal(
|
|
56
|
-
pretty(["i", "am", "just", "another", "array", null, 1, 2]),
|
|
57
|
-
'- "i"<br/>- "am"<br/>- "just"<br/>- "another"<br/>- "array"<br/>- 1<br/>- 2',
|
|
58
|
-
);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
t.test("prettifies can exclude object keys", function (tt) {
|
|
62
|
-
tt.plan(4);
|
|
63
|
-
|
|
64
|
-
tt.equal(
|
|
65
|
-
pretty(
|
|
66
|
-
{
|
|
67
|
-
ignoreMe: "ignore me",
|
|
68
|
-
includeMe: "keep me",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
excludes: null,
|
|
72
|
-
},
|
|
73
|
-
),
|
|
74
|
-
'- "ignore me"<br/>- "keep me"',
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
tt.equal(
|
|
78
|
-
pretty(
|
|
79
|
-
{
|
|
80
|
-
ignoreMe: "ignore me",
|
|
81
|
-
includeMe: "keep me",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
excludes: [],
|
|
85
|
-
},
|
|
86
|
-
),
|
|
87
|
-
'- "ignore me"<br/>- "keep me"',
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
tt.equal(
|
|
91
|
-
pretty(
|
|
92
|
-
{
|
|
93
|
-
ignoreMe: "ignore me",
|
|
94
|
-
includeMe: "keep me",
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
excludes: ["something else"],
|
|
98
|
-
},
|
|
99
|
-
),
|
|
100
|
-
'- "ignore me"<br/>- "keep me"',
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
tt.equal(
|
|
104
|
-
pretty(
|
|
105
|
-
{
|
|
106
|
-
ignoreMe: "ignore me",
|
|
107
|
-
includeMe: "keep me",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
excludes: ["ignoreMe"],
|
|
111
|
-
},
|
|
112
|
-
),
|
|
113
|
-
'"keep me"',
|
|
114
|
-
);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import VideomailError from "./../../src/js/util/videomailError";
|
|
2
|
-
import test from "tape-catch";
|
|
3
|
-
|
|
4
|
-
const fakeOptions = {
|
|
5
|
-
debug() {},
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
test("Videomail Error:", function (t) {
|
|
9
|
-
t.test("arguments", function (tt) {
|
|
10
|
-
tt.test("no arguments", function (tt) {
|
|
11
|
-
tt.plan(5);
|
|
12
|
-
|
|
13
|
-
const err = new VideomailError();
|
|
14
|
-
|
|
15
|
-
tt.ok(err instanceof VideomailError);
|
|
16
|
-
tt.ok(err instanceof Error);
|
|
17
|
-
|
|
18
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
19
|
-
tt.equal(err.message, "");
|
|
20
|
-
tt.equal(err.explanation, undefined);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
tt.test("all undefined", function (tt) {
|
|
24
|
-
tt.plan(3);
|
|
25
|
-
|
|
26
|
-
const err = new VideomailError(
|
|
27
|
-
undefined,
|
|
28
|
-
{
|
|
29
|
-
explanation: undefined,
|
|
30
|
-
},
|
|
31
|
-
fakeOptions,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
35
|
-
tt.equal(err.message, "");
|
|
36
|
-
tt.equal(err.explanation, undefined);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
tt.test("one message", function (tt) {
|
|
40
|
-
tt.plan(3);
|
|
41
|
-
|
|
42
|
-
const err = new VideomailError("one message", fakeOptions);
|
|
43
|
-
|
|
44
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
45
|
-
tt.equal(err.message, "one message");
|
|
46
|
-
tt.equal(err.explanation, undefined);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
tt.test("and an explanation", function (tt) {
|
|
50
|
-
tt.plan(3);
|
|
51
|
-
|
|
52
|
-
const err = new VideomailError(
|
|
53
|
-
"one message",
|
|
54
|
-
{
|
|
55
|
-
explanation: "and an explanation",
|
|
56
|
-
},
|
|
57
|
-
fakeOptions,
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
61
|
-
tt.equal(err.message, "one message");
|
|
62
|
-
tt.equal(err.explanation, "and an explanation");
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
t.test("static create(err)", function (tt) {
|
|
67
|
-
tt.test("null", function (tt) {
|
|
68
|
-
tt.plan(3);
|
|
69
|
-
|
|
70
|
-
const err = VideomailError.create(undefined, undefined, {
|
|
71
|
-
debug() {}, // so that it wont pollute output during tests
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
tt.equal(err.toString(), "Videomail Error");
|
|
75
|
-
tt.equal(err.message, "");
|
|
76
|
-
tt.equal(err.explanation, undefined);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
tt.test("no arguments", function (tt) {
|
|
80
|
-
tt.plan(3);
|
|
81
|
-
|
|
82
|
-
const err = VideomailError.create(new Error(), fakeOptions);
|
|
83
|
-
|
|
84
|
-
tt.equal(err.toString(), "Videomail Error: Error");
|
|
85
|
-
tt.equal(err.message, "Error");
|
|
86
|
-
tt.equal(err.explanation, undefined);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
tt.test("undefined message", function (tt) {
|
|
90
|
-
tt.plan(3);
|
|
91
|
-
|
|
92
|
-
const err = VideomailError.create(new Error(undefined), fakeOptions);
|
|
93
|
-
|
|
94
|
-
tt.equal(err.toString(), "Videomail Error: Error");
|
|
95
|
-
tt.equal(err.message, "Error");
|
|
96
|
-
tt.equal(err.explanation, undefined);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
tt.test("bad integer", function (tt) {
|
|
100
|
-
tt.plan(3);
|
|
101
|
-
|
|
102
|
-
const err = VideomailError.create(123, fakeOptions);
|
|
103
|
-
|
|
104
|
-
tt.equal(err.toString(), "Videomail Error: 123");
|
|
105
|
-
tt.equal(err.message, "123");
|
|
106
|
-
tt.equal(err.explanation, undefined);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
tt.test("one message", function (tt) {
|
|
110
|
-
tt.plan(3);
|
|
111
|
-
|
|
112
|
-
const err = VideomailError.create("one message", fakeOptions);
|
|
113
|
-
|
|
114
|
-
tt.equal(err.toString(), "Videomail Error: one message");
|
|
115
|
-
tt.equal(err.message, "one message");
|
|
116
|
-
tt.equal(err.explanation, undefined);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
tt.test("deals with VideomailError instance", function (tt) {
|
|
120
|
-
tt.plan(3);
|
|
121
|
-
|
|
122
|
-
const err = VideomailError.create(
|
|
123
|
-
new VideomailError("i am already instantiated", fakeOptions),
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
tt.equal(err.toString(), "Videomail Error: i am already instantiated");
|
|
127
|
-
tt.equal(err.message, "i am already instantiated");
|
|
128
|
-
tt.equal(err.explanation, undefined);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
tt.test("PERMISSION_DENIED", function (tt) {
|
|
132
|
-
tt.plan(6);
|
|
133
|
-
|
|
134
|
-
const err1 = VideomailError.create(
|
|
135
|
-
{
|
|
136
|
-
code: 1,
|
|
137
|
-
PERMISSION_DENIED: 1,
|
|
138
|
-
},
|
|
139
|
-
fakeOptions,
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
tt.equal(err1.toString(), "Videomail Error: Permission denied");
|
|
143
|
-
tt.equal(err1.message, "Permission denied");
|
|
144
|
-
tt.equal(
|
|
145
|
-
err1.explanation,
|
|
146
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
const err2 = VideomailError.create(
|
|
150
|
-
{
|
|
151
|
-
code: 2,
|
|
152
|
-
PERMISSION_DENIED: 2,
|
|
153
|
-
},
|
|
154
|
-
fakeOptions,
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
tt.equal(err2.toString(), "Videomail Error");
|
|
158
|
-
tt.equal(err2.message, "");
|
|
159
|
-
tt.equal(err2.explanation, "- 2<br/>- 2");
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
tt.test("NOT_ALLOWED_ERROR", function (tt) {
|
|
163
|
-
tt.plan(3);
|
|
164
|
-
|
|
165
|
-
const err1 = VideomailError.create(VideomailError.NOT_ALLOWED_ERROR, fakeOptions);
|
|
166
|
-
|
|
167
|
-
tt.equal(err1.toString(), "Videomail Error: Permission denied");
|
|
168
|
-
tt.equal(err1.message, "Permission denied");
|
|
169
|
-
tt.equal(
|
|
170
|
-
err1.explanation,
|
|
171
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
172
|
-
);
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
tt.test("with bad name in object", function (tt) {
|
|
176
|
-
tt.plan(3);
|
|
177
|
-
|
|
178
|
-
const err = VideomailError.create(
|
|
179
|
-
{
|
|
180
|
-
name: 1,
|
|
181
|
-
},
|
|
182
|
-
fakeOptions,
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
tt.equal(err.toString(), "Videomail Error: 1");
|
|
186
|
-
tt.equal(err.message, "1");
|
|
187
|
-
tt.equal(err.explanation, undefined);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
tt.test("with NO_DEVICES_FOUND as name in object", function (tt) {
|
|
191
|
-
tt.plan(3);
|
|
192
|
-
|
|
193
|
-
const err = VideomailError.create(
|
|
194
|
-
{
|
|
195
|
-
name: "NO_DEVICES_FOUND",
|
|
196
|
-
},
|
|
197
|
-
fakeOptions,
|
|
198
|
-
);
|
|
199
|
-
|
|
200
|
-
tt.equal(err.toString(), "Videomail Error: No webcam found");
|
|
201
|
-
tt.equal(err.message, "No webcam found");
|
|
202
|
-
tt.equal(
|
|
203
|
-
err.explanation,
|
|
204
|
-
"Your browser cannot find a webcam attached to your machine.",
|
|
205
|
-
);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
tt.test("with PermissionDeniedError as name in object", function (tt) {
|
|
209
|
-
tt.plan(3);
|
|
210
|
-
|
|
211
|
-
const err = VideomailError.create(
|
|
212
|
-
{
|
|
213
|
-
name: "PermissionDeniedError",
|
|
214
|
-
},
|
|
215
|
-
fakeOptions,
|
|
216
|
-
);
|
|
217
|
-
|
|
218
|
-
tt.equal(err.toString(), "Videomail Error: Permission denied");
|
|
219
|
-
tt.equal(err.message, "Permission denied");
|
|
220
|
-
tt.equal(
|
|
221
|
-
err.explanation,
|
|
222
|
-
"Cannot access your webcam. This can have two reasons:<br/>a) you blocked access to webcam; or<br/>b) your webcam is already in use.",
|
|
223
|
-
);
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
tt.test("with HARDWARE_UNAVAILABLE as name in object", function (tt) {
|
|
227
|
-
tt.plan(3);
|
|
228
|
-
|
|
229
|
-
const err = VideomailError.create(
|
|
230
|
-
{
|
|
231
|
-
name: "HARDWARE_UNAVAILABLE",
|
|
232
|
-
},
|
|
233
|
-
fakeOptions,
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
tt.equal(err.toString(), "Videomail Error: Webcam is unavailable");
|
|
237
|
-
tt.equal(err.message, "Webcam is unavailable");
|
|
238
|
-
tt.equal(err.explanation, "Maybe it is already busy in another window?");
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
tt.test('with "Not connected" as name in object', function (tt) {
|
|
242
|
-
tt.plan(3);
|
|
243
|
-
|
|
244
|
-
const err = VideomailError.create(
|
|
245
|
-
{
|
|
246
|
-
name: "Not connected",
|
|
247
|
-
},
|
|
248
|
-
fakeOptions,
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
tt.equal(err.toString(), "Videomail Error: Unable to connect");
|
|
252
|
-
tt.equal(err.message, "Unable to connect");
|
|
253
|
-
tt.equal(
|
|
254
|
-
err.explanation,
|
|
255
|
-
"Either the videomail server or your connection is down. Trying to reconnect every few seconds …",
|
|
256
|
-
);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
tt.test('with "Not connected" as argument', function (tt) {
|
|
260
|
-
tt.plan(3);
|
|
261
|
-
|
|
262
|
-
const err = VideomailError.create("Not connected", fakeOptions);
|
|
263
|
-
|
|
264
|
-
tt.equal(err.toString(), "Videomail Error: Unable to connect");
|
|
265
|
-
tt.equal(err.message, "Unable to connect");
|
|
266
|
-
tt.equal(
|
|
267
|
-
err.explanation,
|
|
268
|
-
"Either the videomail server or your connection is down. Trying to reconnect every few seconds …",
|
|
269
|
-
);
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
tt.test("with NO_VIDEO_FEED as name in object", function (tt) {
|
|
273
|
-
tt.plan(3);
|
|
274
|
-
|
|
275
|
-
const err = VideomailError.create(
|
|
276
|
-
{
|
|
277
|
-
name: "NO_VIDEO_FEED",
|
|
278
|
-
},
|
|
279
|
-
fakeOptions,
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
tt.equal(err.toString(), "Videomail Error: No video feed found!");
|
|
283
|
-
tt.equal(err.message, "No video feed found!");
|
|
284
|
-
tt.equal(err.explanation, "Your webcam is already used in another browser.");
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
tt.test('with "Starting video failed" as name in object', function (tt) {
|
|
288
|
-
tt.plan(3);
|
|
289
|
-
|
|
290
|
-
const err = VideomailError.create(
|
|
291
|
-
{
|
|
292
|
-
name: "Starting video failed",
|
|
293
|
-
},
|
|
294
|
-
fakeOptions,
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
tt.equal(err.toString(), "Videomail Error: Starting video failed");
|
|
298
|
-
tt.equal(err.message, "Starting video failed");
|
|
299
|
-
tt.equal(
|
|
300
|
-
err.explanation,
|
|
301
|
-
"Most likely this happens when the webcam is already active in another browser.",
|
|
302
|
-
);
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
tt.test("with DevicesNotFoundError as name in object", function (tt) {
|
|
306
|
-
tt.plan(3);
|
|
307
|
-
|
|
308
|
-
const err = VideomailError.create(
|
|
309
|
-
{
|
|
310
|
-
name: "DevicesNotFoundError",
|
|
311
|
-
},
|
|
312
|
-
fakeOptions,
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
tt.equal(err.toString(), "Videomail Error: No available webcam could be found");
|
|
316
|
-
tt.equal(err.message, "No available webcam could be found");
|
|
317
|
-
tt.equal(
|
|
318
|
-
err.explanation,
|
|
319
|
-
"Looks like you do not have any webcam attached to your machine; or the one you plugged in is already used.",
|
|
320
|
-
);
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Buttons from "./../../src/js/wrappers/buttons";
|
|
4
|
-
|
|
5
|
-
test("Buttons:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Buttons(null, {
|
|
11
|
-
debug() {},
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Container from "./../../src/js/wrappers/container";
|
|
4
|
-
|
|
5
|
-
test("Container:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Container({
|
|
11
|
-
video: {
|
|
12
|
-
fps: 15,
|
|
13
|
-
},
|
|
14
|
-
image: {},
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Form from "./../../src/js/wrappers/form";
|
|
4
|
-
|
|
5
|
-
test("Form:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Form();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from "tape-catch";
|
|
2
|
-
|
|
3
|
-
import Notifier from "./../../src/js/wrappers/visuals/notifier";
|
|
4
|
-
|
|
5
|
-
test("Notifier:", function (t) {
|
|
6
|
-
t.test("can be instantiated", function (tt) {
|
|
7
|
-
tt.plan(1);
|
|
8
|
-
|
|
9
|
-
tt.doesNotThrow(function () {
|
|
10
|
-
return new Notifier();
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
});
|