Example #1
0
 .then((contents) => {
   assert.calledOnce(spark.internal.board.decryptSingleFileContent);
   assert.deepEqual(contents[0].metadata, {
     type: 'image',
     size: 123
   });
 });
Example #2
0
 it('should have created a meeting object with public properties', () => {
   assert.exists(meeting);
   assert.exists(meeting.spark);
   assert.exists(meeting.options);
   assert.exists(meeting.attrs);
   assert.exists(meeting.id);
   assert.equal(meeting.userId, uuid1);
   assert.equal(meeting.resource, uuid2);
   assert.equal(meeting.deviceUrl, uuid3);
   assert.equal(meeting.roapSeq, -1);
   assert.deepEqual(meeting.meetingInfo, {});
   assert.instanceOf(meeting.members, Members);
   assert.instanceOf(meeting.roap, Roap);
   assert.isNull(meeting.reconnectionManager);
   assert.isNull(meeting.audio);
   assert.isNull(meeting.video);
   assert.instanceOf(meeting.meetingFSM, StateMachine);
   assert.isNull(meeting.stats);
   assert.isNull(meeting.convoId);
   assert.equal(meeting.locusUrl, url1);
   assert.isNull(meeting.sipUri);
   assert.isNull(meeting.partner);
   assert.isNull(meeting.type);
   assert.isNull(meeting.owner);
   assert.isNull(meeting.hostId);
   assert.isNull(meeting.policy);
   assert.instanceOf(meeting.meetingRequest, MeetingRequest);
   assert.instanceOf(meeting.locusInfo, LocusInfo);
   assert.instanceOf(meeting.mediaProperties, MediaProperties);
 });
Example #3
0
    it(`redacts email addresses`, () => {
      const message = {
        blarg: `test@example.com`
      };

      assert.deepEqual(spark.logger.filter(message), [{
        blarg: `-- REDACTED --`
      }]);
    });
Example #4
0
 it('should parse the locus object and set meeting properties and return null', () => {
   meeting.type = 'CALL';
   meeting.parseLocus({url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
   assert.calledOnce(meeting.setLocus);
   assert.calledWith(meeting.setLocus, {url: url1, participants: [{id: uuid1}], self: {id: uuid2}});
   assert.calledOnce(MeetingUtil.getLocusPartner);
   assert.calledWith(MeetingUtil.getLocusPartner, [{id: uuid1}], {id: uuid2});
   assert.deepEqual(meeting.partner, {person: {sipUrl: uuid3}});
   assert.equal(meeting.sipUri, uuid3);
 });
Example #5
0
            .then((fileContent) => {
              testContent = fileContent[0].items[0];
              assert.equal(testContent.type, 'FILE', 'content type should be image');
              assert.property(testContent, 'contentUrl', 'content should contain contentId property');
              assert.property(testContent, 'channelUrl', 'content should contain contentUrl property');
              assert.property(testContent, 'file', 'content should contain file property');
              assert.property(testContent.file, 'scr', 'content file should contain scr property');
              assert.deepEqual(testContent.metadata, {});

              return participants[0].spark.internal.board.getContents(board);
            })
Example #6
0
 sinon.stub(call.media, 'createOffer').callsFake(() => {
   try {
     assert.isTrue(call.media.constraints.audio);
     assert.deepEqual(call.media.constraints.video, {
       facingMode: {
         ideal: 'user'
       }
     });
     done();
   }
   catch (err) {
     done(err);
   }
 });
Example #7
0
 .then((result) => assert.deepEqual(result, feature.value));
Example #8
0
 .then((w) => {
   assert.deepEqual(w, webhook);
 });
Example #9
0
 .then((room) => {
   assert.isRoom(room);
   assert.deepEqual(room, r);
 });
Example #10
0
 .then((res) => {
   assert.isFalse(mockRealtimeChannel.isSharingMercury);
   assert.deepEqual(res, replaceBindingRes);
   assert.match(socketOpenStub.args[0][0], new RegExp(replaceBindingRes.webSocketUrl));
   assert.calledWith(socketOpenStub, sinon.match(replaceBindingRes.webSocketUrl), sinon.match.any);
 })
 .then((req) => assert.deepEqual(req, mockRequest));
Example #12
0
 .then((result) => assert.deepEqual(result, true))));
Example #13
0
          .then((page) => {
            assert.lengthOf(page, 1);
            assert.deepEqual(page.items[0], contentsToKeep[0]);

            return page;
          });
Example #14
0
          .then((res) => {
            assert.deepEqual(imageRes, res.image);

            // ensure others can download the image
            return participants[2].spark.internal.encryption.decryptScr(board.defaultEncryptionKeyUrl, res.image.scr);
          })
Example #15
0
 .then((res) => {
   assert.deepEqual(res, removeBindingRes);
   assert.called(spark.internal.board.realtime.realtimeChannels.remove);
 }));
Example #16
0
 .then((res) => {
   assert.isFalse(mockRealtimeChannel.isSharingMercury);
   assert.deepEqual(res, replaceBindingRes);
   assert.called(mockRealtimeChannel.connect);
   mockRealtimeChannel.connect.restore();
 });
Example #17
0
 .then((m) => {
   assert.deepEqual(m, membership);
 });
Example #18
0
 it('returns object containing one link if only one link header passed as a string', () => {
   assert.deepEqual(Page.parseLinkHeaders(singleLinkHeader), {
     cisco: 'https://www.cisco.com'
   });
 });
Example #19
0
 .then((m) => {
   assert.deepEqual(m, membership);
   assert.isTrue(m.isModerator);
 });
Example #20
0
 it('stores response items', () => {
   assert.deepEqual(page.items, [1, 2, 3]);
 });
Example #21
0
 it('returns empty object if there are not any link headers', () => {
   assert.deepEqual(Page.parseLinkHeaders(), {});
 });
Example #22
0
 .then((res) => {
   assert.isTrue(mockRealtimeChannel.isSharingMercury);
   assert.deepEqual(res, replaceBindingRes);
 }));
Example #23
0
 it('returns object containing multiple links when multiple headers passed as an array', () => {
   assert.deepEqual(Page.parseLinkHeaders(multipleLinkHeader), {
     ciscospark: 'https://www.ciscospark.com',
     cisco: 'https://www.cisco.com'
   });
 });
Example #24
0
 it('should get the meeting by key', () => {
   assert.equal(Object.keys(meetingCollection.meetings).length, 2);
   assert.deepEqual(meetingCollection.getByKey('value', 'test'), {value: 'test', id: uuid1});
 });
Example #25
0
 .then((nextPage) => {
   assert.deepEqual(nextPage.items, [4, 5, 6]);
   assert.calledWith(spark.request, {uri: 'https://www.cisco.com'});
 }));
Example #26
0
 .then((m) => {
   assert.isMessage(m);
   assert.deepEqual(m, message);
 }));