From a84fe5b5643be10f0aa53209d7a21f42fef518e7 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 7 Feb 2024 08:41:59 -0300 Subject: [PATCH] test: make emoji custom test fully independent --- apps/meteor/tests/end-to-end/api/12-emoji-custom.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/meteor/tests/end-to-end/api/12-emoji-custom.js b/apps/meteor/tests/end-to-end/api/12-emoji-custom.js index ba9c6756b4705..488be47852ca1 100644 --- a/apps/meteor/tests/end-to-end/api/12-emoji-custom.js +++ b/apps/meteor/tests/end-to-end/api/12-emoji-custom.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { before, describe, it } from 'mocha'; +import { before, describe, it, after } from 'mocha'; import { getCredentials, api, request, credentials } from '../../data/api-data.js'; import { imgURL } from '../../data/interactions'; @@ -8,10 +8,18 @@ const customEmojiName = `my-custom-emoji-${Date.now()}`; let createdCustomEmoji; describe('[EmojiCustom]', function () { + let withoutAliases; + this.retries(0); before((done) => getCredentials(done)); + after(() => + request.post(api('emoji-custom.delete')).set(credentials).send({ + emojiId: withoutAliases._id, + }), + ); + describe('[/emoji-custom.create]', () => { it('should create new custom emoji', (done) => { request @@ -75,6 +83,7 @@ describe('[EmojiCustom]', function () { expect(res.body.emojis).to.have.property('remove').and.to.be.a('array').and.to.have.lengthOf(0); createdCustomEmoji = res.body.emojis.update.find((emoji) => emoji.name === customEmojiName); + withoutAliases = res.body.emojis.update.find((emoji) => emoji.name === `${customEmojiName}-without-aliases`); }) .end(done); });