Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Jan 27, 2023
1 parent 92a1ff2 commit 4e1140b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions apps/meteor/tests/end-to-end/api/05-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,27 +749,37 @@ describe('[Chat]', function () {
let ytEmbedMsgId;
let imgUrlMsgId;

before(async () => {
await Promise.all([updateSetting('API_EmbedIgnoredHosts', ''), updateSetting('API_EmbedSafePorts', '80, 443, 3000')]);
});
after(async () => {
await Promise.all([
updateSetting('API_EmbedIgnoredHosts', 'localhost, 127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16'),
updateSetting('API_EmbedSafePorts', '80, 443'),
]);
});

before(async () => {
const ytEmbedMsgPayload = {
_id: `id-${Date.now()}`,
rid: 'GENERAL',
msg: 'https://www.youtube.com/watch?v=T2v29gK8fP4',
emoji: ':smirk:',
};
const ytPostResponse = await request.post(api('chat.sendMessage')).set(credentials).send({ message: ytEmbedMsgPayload });
ytEmbedMsgId = ytPostResponse.body.message._id;
});

before(async () => {
const imgUrlMsgPayload = {
_id: `id-${Date.now()}1`,
rid: 'GENERAL',
msg: 'http://localhost:3000/images/logo/logo.png',
emoji: ':smirk:',
};

const ytPostResponse = await request.post(api('chat.sendMessage')).set(credentials).send({ message: ytEmbedMsgPayload });

const imgUrlResponse = await request.post(api('chat.sendMessage')).set(credentials).send({ message: imgUrlMsgPayload });

ytEmbedMsgId = ytPostResponse.body.message._id;
imgUrlMsgId = imgUrlResponse.body.message._id;
imgUrlMsgId = imgUrlResponse.body.message._id;
});

Expand Down

0 comments on commit 4e1140b

Please sign in to comment.