diff --git a/tests/end-to-end/api/05-chat.js b/tests/end-to-end/api/05-chat.js index 820348218cf..2572e3a1681 100644 --- a/tests/end-to-end/api/05-chat.js +++ b/tests/end-to-end/api/05-chat.js @@ -735,7 +735,7 @@ describe('[Chat]', function() { imgUrlMsgId = imgUrlResponse.body.message._id; }); - it('should embed an youtube preview if message has a youtube url', (done) => { + it('should have an iframe oembed with style max-width', (done) => { setTimeout(() => { request.get(api('chat.getMessage')) .set(credentials) @@ -745,10 +745,16 @@ describe('[Chat]', function() { .expect('Content-Type', 'application/json') .expect(200) .expect((res) => { - const msgMetadataUrl = res.body.message.urls[0].meta; - const expectedOembedHtml = ''; - - expect(msgMetadataUrl).to.have.property('oembedHtml', expectedOembedHtml); + expect(res.body) + .to.have.property('message') + .to.have.property('urls') + .to.be.an('array') + .that.is.not.empty; + + expect(res.body.message.urls[0]) + .to.have.property('meta') + .to.have.property('oembedHtml') + .to.have.string('