@sprucelabs/heartwood-view-controllers 118.2.2 → 118.2.4
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.
|
@@ -3,7 +3,7 @@ import WebRtcPlayerViewController from '../../viewControllers/webRtcStreaming/We
|
|
|
3
3
|
declare const webRtcAssert: {
|
|
4
4
|
beforeEach: (views: SimpleViewControllerFactory) => void;
|
|
5
5
|
cardRendersPlayer: (vc: ViewController<Card>, id?: string) => WebRtcPlayerViewController;
|
|
6
|
-
actionCreatesOffer: (vc: WebRtcPlayerViewController, action: () => void | Promise<void>, expectedOptions?: RTCOfferOptions) => Promise<
|
|
6
|
+
actionCreatesOffer: (vc: WebRtcPlayerViewController, action: () => void | Promise<void>, expectedOptions?: RTCOfferOptions) => Promise<string>;
|
|
7
7
|
answerSet: (vc: WebRtcPlayerViewController, answerSdp?: string) => Promise<void>;
|
|
8
8
|
croppingIsEnabled: (vc: WebRtcPlayerViewController) => void;
|
|
9
9
|
croppingIsDisabled: (vc: WebRtcPlayerViewController) => void;
|
|
@@ -13,6 +13,7 @@ export default webRtcAssert;
|
|
|
13
13
|
export declare class AssertingWebRtcPlayerViewController extends WebRtcPlayerViewController {
|
|
14
14
|
private onCreateOfferHandler?;
|
|
15
15
|
private passedAnswer?;
|
|
16
|
+
static lastGeretateOfferSdp: string;
|
|
16
17
|
onCreateOffer(cb: (offerOptions: RTCOfferOptions) => void): void;
|
|
17
18
|
createOffer(offerOptions: RTCOfferOptions): Promise<string>;
|
|
18
19
|
setAnswer(answerSdp: string): Promise<void>;
|
|
@@ -20,7 +20,7 @@ const webRtcAssert = {
|
|
|
20
20
|
assertOptions({ vc }, ['vc']);
|
|
21
21
|
const model = renderUtil.render(vc);
|
|
22
22
|
const players = pluckAllFromView(model, 'webRtcPlayer');
|
|
23
|
-
assert.isAbove(players.length, 0, `Your card is not rendering a webrtc player!. Try:\n\nthis.
|
|
23
|
+
assert.isAbove(players.length, 0, `Your card is not rendering a webrtc player!. Try:\n\nthis.playerVc = this.Controller('web-rtc-player', {})\nthis.cardVc = this.Controller('card', { webRtcPlayer: this.playerVc.render() })`);
|
|
24
24
|
if (id) {
|
|
25
25
|
for (const player of players) {
|
|
26
26
|
if ((player === null || player === void 0 ? void 0 : player.id) === id) {
|
|
@@ -44,7 +44,8 @@ const webRtcAssert = {
|
|
|
44
44
|
if (expectedOptions) {
|
|
45
45
|
assert.isEqualDeep(passedOptions, expectedOptions, `The options you passed to createOffer did not matching.`);
|
|
46
46
|
}
|
|
47
|
-
assert.isTrue(wasHit, `You did not create an offer. Try 'const offer = await this.
|
|
47
|
+
assert.isTrue(wasHit, `You did not create an offer. Try 'const offer = await this.playerVc.createOffer()'`);
|
|
48
|
+
return AssertingWebRtcPlayerViewController.lastGeretateOfferSdp;
|
|
48
49
|
}),
|
|
49
50
|
answerSet: (vc, answerSdp) => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
51
|
assertOptions({ vc }, ['vc']);
|
|
@@ -78,7 +79,8 @@ export class AssertingWebRtcPlayerViewController extends WebRtcPlayerViewControl
|
|
|
78
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
80
|
var _a;
|
|
80
81
|
(_a = this.onCreateOfferHandler) === null || _a === void 0 ? void 0 : _a.call(this, offerOptions);
|
|
81
|
-
|
|
82
|
+
AssertingWebRtcPlayerViewController.lastGeretateOfferSdp = generateId();
|
|
83
|
+
return AssertingWebRtcPlayerViewController.lastGeretateOfferSdp;
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
setAnswer(answerSdp) {
|
|
@@ -3,7 +3,7 @@ import WebRtcPlayerViewController from '../../viewControllers/webRtcStreaming/We
|
|
|
3
3
|
declare const webRtcAssert: {
|
|
4
4
|
beforeEach: (views: SimpleViewControllerFactory) => void;
|
|
5
5
|
cardRendersPlayer: (vc: ViewController<Card>, id?: string) => WebRtcPlayerViewController;
|
|
6
|
-
actionCreatesOffer: (vc: WebRtcPlayerViewController, action: () => void | Promise<void>, expectedOptions?: RTCOfferOptions) => Promise<
|
|
6
|
+
actionCreatesOffer: (vc: WebRtcPlayerViewController, action: () => void | Promise<void>, expectedOptions?: RTCOfferOptions) => Promise<string>;
|
|
7
7
|
answerSet: (vc: WebRtcPlayerViewController, answerSdp?: string) => Promise<void>;
|
|
8
8
|
croppingIsEnabled: (vc: WebRtcPlayerViewController) => void;
|
|
9
9
|
croppingIsDisabled: (vc: WebRtcPlayerViewController) => void;
|
|
@@ -13,6 +13,7 @@ export default webRtcAssert;
|
|
|
13
13
|
export declare class AssertingWebRtcPlayerViewController extends WebRtcPlayerViewController {
|
|
14
14
|
private onCreateOfferHandler?;
|
|
15
15
|
private passedAnswer?;
|
|
16
|
+
static lastGeretateOfferSdp: string;
|
|
16
17
|
onCreateOffer(cb: (offerOptions: RTCOfferOptions) => void): void;
|
|
17
18
|
createOffer(offerOptions: RTCOfferOptions): Promise<string>;
|
|
18
19
|
setAnswer(answerSdp: string): Promise<void>;
|
|
@@ -17,7 +17,7 @@ const webRtcAssert = {
|
|
|
17
17
|
(0, schema_1.assertOptions)({ vc }, ['vc']);
|
|
18
18
|
const model = render_utility_1.default.render(vc);
|
|
19
19
|
const players = (0, assertSupport_1.pluckAllFromView)(model, 'webRtcPlayer');
|
|
20
|
-
test_utils_1.assert.isAbove(players.length, 0, `Your card is not rendering a webrtc player!. Try:\n\nthis.
|
|
20
|
+
test_utils_1.assert.isAbove(players.length, 0, `Your card is not rendering a webrtc player!. Try:\n\nthis.playerVc = this.Controller('web-rtc-player', {})\nthis.cardVc = this.Controller('card', { webRtcPlayer: this.playerVc.render() })`);
|
|
21
21
|
if (id) {
|
|
22
22
|
for (const player of players) {
|
|
23
23
|
if (player?.id === id) {
|
|
@@ -41,7 +41,8 @@ const webRtcAssert = {
|
|
|
41
41
|
if (expectedOptions) {
|
|
42
42
|
test_utils_1.assert.isEqualDeep(passedOptions, expectedOptions, `The options you passed to createOffer did not matching.`);
|
|
43
43
|
}
|
|
44
|
-
test_utils_1.assert.isTrue(wasHit, `You did not create an offer. Try 'const offer = await this.
|
|
44
|
+
test_utils_1.assert.isTrue(wasHit, `You did not create an offer. Try 'const offer = await this.playerVc.createOffer()'`);
|
|
45
|
+
return AssertingWebRtcPlayerViewController.lastGeretateOfferSdp;
|
|
45
46
|
},
|
|
46
47
|
answerSet: async (vc, answerSdp) => {
|
|
47
48
|
(0, schema_1.assertOptions)({ vc }, ['vc']);
|
|
@@ -73,7 +74,8 @@ class AssertingWebRtcPlayerViewController extends WebRtcPlayer_vc_1.default {
|
|
|
73
74
|
}
|
|
74
75
|
async createOffer(offerOptions) {
|
|
75
76
|
this.onCreateOfferHandler?.(offerOptions);
|
|
76
|
-
|
|
77
|
+
AssertingWebRtcPlayerViewController.lastGeretateOfferSdp = (0, test_utils_1.generateId)();
|
|
78
|
+
return AssertingWebRtcPlayerViewController.lastGeretateOfferSdp;
|
|
77
79
|
}
|
|
78
80
|
async setAnswer(answerSdp) {
|
|
79
81
|
this.passedAnswer = answerSdp;
|
package/package.json
CHANGED