Skip to content

Commit 1ef4f8a

Browse files
Mohit TejaniMohit Tejani
authored andcommitted
test(titanium) update to test unsubscribe with ee
1 parent 9780ab6 commit 1ef4f8a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

test/dist/web-titanium.test.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,15 @@ describe('#distribution test (titanium)', function () {
150150
});
151151

152152
it('should have to unsubscribe', function (done) {
153-
pubnub.disconnect();
154-
pubnub.removeListener(listener);
155-
pubnub.reconnect();
153+
pubnub.subscribe({ channels: [myChannel1] });
156154

157155
var finished = false;
158156

159157
pubnub.addListener({
160158
status: function (st) {
161159
try {
162-
if(st.category === 'PNConnectedCategory') {
163-
// this is expected due to async nature of the reconnect()
164-
return;
165-
}
166-
// This unsibscribe operation triggers a subscription changed event
167-
expect(st.category).to.be.equal('PNSubscriptionChangedCategory');
160+
expect(st.operation).to.be.equal('PNUnsubscribeOperation');
161+
168162
if (!finished) {
169163
// prevent calling done twice
170164
finished = true;
@@ -175,6 +169,6 @@ describe('#distribution test (titanium)', function () {
175169
}
176170
},
177171
});
178-
pubnub.unsubscribe({ channels: [myChannel1] });
172+
pubnub.unsubscribeAll();
179173
});
180-
});
174+
});

0 commit comments

Comments
 (0)