Skip to content

Commit 6c86a9a

Browse files
author
dimaspirit
committed
pending test 'delete event' in Pushnotification
adapt WebRTC - pending in Node env.
1 parent 8669c65 commit 6c86a9a

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

spec/QB-PushnotificationsSpec.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,16 @@ describe('PushNotifications API', function() {
168168

169169
/**
170170
* WARNING!
171-
* This spec break all. Need fix
171+
* If run in Node and then will run again - something broken.
172+
* Without running in Node env. - everything all right.
173+
* Need review delete event and fix it!
172174
*/
173-
xit("can delete event", function(done){
174-
console.log('can delete event!');
175+
it("can delete event", function(done){
176+
if(isNodeEnv) {
177+
pending('This describe "XMPP - real time messaging" isn\'t supported outside of the browser');
178+
}
179+
175180
QB.pushnotifications.events.delete(eventId, function(err, response) {
176-
console.log(err);
177181
expect(err.code).toEqual(200);
178182

179183
done();

spec/QB-WebRTCSpec.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
describe('WebRTC API', function() {
22
'use strict';
3-
4-
var session,
5-
LOGIN_TIMEOUT = 10000;
3+
var LOGIN_TIMEOUT = 10000;
4+
5+
var isNodeEnv = typeof window === 'undefined' && typeof exports === 'object';
6+
7+
var QB = isNodeEnv ? require('../js/qbMain') : window.QB;
8+
var CREDENTIALS = isNodeEnv ? require('./config').CREDENTIALS : window.CREDENTIALS;
9+
var CONFIG = isNodeEnv ? require('./config').CONFIG : window.CONFIG;
10+
var QBUser1 = isNodeEnv ? require('./config').QBUser1 : window.QBUser1;
11+
var QBUser2 = isNodeEnv ? require('./config').QBUser2 : window.QBUser2;
12+
13+
var session;
614

715
beforeAll(function(done){
816
QB.init(CREDENTIALS.appId, CREDENTIALS.authKey, CREDENTIALS.authSecret);
@@ -16,8 +24,11 @@ describe('WebRTC API', function() {
1624
});
1725
}, LOGIN_TIMEOUT);
1826

19-
2027
it('can create a session', function() {
28+
if(isNodeEnv) {
29+
pending('WebRTC API isn\'t supported outside of the browser');
30+
}
31+
2132
session = QB.webrtc.createNewSession([QBUser2.id], QB.webrtc.CallType.VIDEO);
2233

2334
expect(session).not.toBeNull();
@@ -27,6 +38,10 @@ describe('WebRTC API', function() {
2738

2839

2940
it('can not create a session with the same opponents', function() {
41+
if(isNodeEnv) {
42+
pending('WebRTC API isn\'t supported outside of the browser');
43+
}
44+
3045
var errorString = 'Can\'t create a session with the same opponentsIDs. There is a session already in NEW or ACTIVE state.';
3146

3247
expect(function() {

spec/support/jasmine.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"QB-ContentSpec.js",
99
"QB-DataSpec.js",
1010
"QB-LocationSpec.js",
11-
"QB-PushnotificationsSpec.js"
11+
"QB-PushnotificationsSpec.js",
12+
"QB-WebRTCSpec.js"
1213
],
1314
"stopSpecOnExpectationFailure": false,
1415
"random": false

0 commit comments

Comments
 (0)