From 8ed3720f87f702738237897ed646ae846d568cbe Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Thu, 15 Feb 2024 12:05:31 -0300 Subject: [PATCH 1/8] fix: Admin can't change room name (#31713) --- .changeset/curly-dodos-tan.md | 5 +++++ apps/meteor/client/views/admin/rooms/EditRoom.tsx | 4 +--- apps/meteor/tests/e2e/administration.spec.ts | 15 +++++++++++++-- apps/meteor/tests/e2e/page-objects/admin.ts | 4 ++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 .changeset/curly-dodos-tan.md diff --git a/.changeset/curly-dodos-tan.md b/.changeset/curly-dodos-tan.md new file mode 100644 index 000000000000..939f21275499 --- /dev/null +++ b/.changeset/curly-dodos-tan.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue not allowing admin users to edit the room name diff --git a/apps/meteor/client/views/admin/rooms/EditRoom.tsx b/apps/meteor/client/views/admin/rooms/EditRoom.tsx index 58a569463aef..18edd8cc815a 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoom.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoom.tsx @@ -96,16 +96,14 @@ const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { const handleArchive = useArchiveRoom(room); - const handleUpdateRoomData = useEffectEvent(async ({ isDefault, roomName, favorite, ...formData }) => { + const handleUpdateRoomData = useEffectEvent(async ({ isDefault, favorite, ...formData }) => { const data = getDirtyFields(formData, dirtyFields); delete data.archived; delete data.favorite; - delete data.roomName; try { await saveAction({ rid: room._id, - roomName: roomType === 'd' ? undefined : roomName, default: isDefault, favorite: { defaultValue: isDefault, favorite }, ...data, diff --git a/apps/meteor/tests/e2e/administration.spec.ts b/apps/meteor/tests/e2e/administration.spec.ts index 8c3bd5c23f6b..2a359bd47f5a 100644 --- a/apps/meteor/tests/e2e/administration.spec.ts +++ b/apps/meteor/tests/e2e/administration.spec.ts @@ -70,7 +70,18 @@ test.describe.parallel('administration', () => { await page.waitForSelector('[qa-room-id="GENERAL"]'); }); - test('should edit target channel', async () => { + test('should edit target channel name', async () => { + await poAdmin.inputSearchRooms.fill(targetChannel); + await poAdmin.getRoomRow(targetChannel).click(); + await poAdmin.roomNameInput.fill(`${targetChannel}-edited`); + await poAdmin.btnSave.click(); + + await expect(poAdmin.getRoomRow(targetChannel)).toContainText(`${targetChannel}-edited`); + + targetChannel = `${targetChannel}-edited`; + }); + + test('should edit target channel type', async () => { await poAdmin.inputSearchRooms.type(targetChannel); await poAdmin.getRoomRow(targetChannel).click(); await poAdmin.privateLabel.click(); @@ -89,7 +100,7 @@ test.describe.parallel('administration', () => { }); test.describe.serial('Default rooms', () => { - test('expect target channell to be default', async () => { + test('expect target channel to be default', async () => { await poAdmin.inputSearchRooms.type(targetChannel); await poAdmin.getRoomRow(targetChannel).click(); await poAdmin.defaultLabel.click(); diff --git a/apps/meteor/tests/e2e/page-objects/admin.ts b/apps/meteor/tests/e2e/page-objects/admin.ts index 022fd609077f..30b58cd29bec 100644 --- a/apps/meteor/tests/e2e/page-objects/admin.ts +++ b/apps/meteor/tests/e2e/page-objects/admin.ts @@ -28,6 +28,10 @@ export class Admin { return this.page.locator(`label >> text=Private`); } + get roomNameInput(): Locator { + return this.page.locator('input[name="roomName"]'); + } + get archivedLabel(): Locator { return this.page.locator('label >> text=Archived'); } From 8daf5d448e23256f4a5ad62b23e8f48491279159 Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Thu, 15 Feb 2024 14:35:50 -0300 Subject: [PATCH 2/8] test: make api methods test fully independent (#31742) --- .../meteor/tests/end-to-end/api/24-methods.js | 126 ++++++++++-------- 1 file changed, 72 insertions(+), 54 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/24-methods.js b/apps/meteor/tests/end-to-end/api/24-methods.js index 121a9a76dd7e..fc6c8bf4020c 100644 --- a/apps/meteor/tests/end-to-end/api/24-methods.js +++ b/apps/meteor/tests/end-to-end/api/24-methods.js @@ -80,6 +80,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should fail if not logged in', (done) => { request .post(methodCall('getThreadMessages')) @@ -180,8 +182,7 @@ describe('Meteor.methods', function () { const roomName = `methods-test-channel-${Date.now()}`; before(async () => { - await updateSetting('Message_Read_Receipt_Enabled', true); - await updateSetting('Message_Read_Receipt_Store_Users', true); + await Promise.all([updateSetting('Message_Read_Receipt_Enabled', true), updateSetting('Message_Read_Receipt_Store_Users', true)]); user = await createUser(); userCredentials = await login(user.username, password); @@ -190,10 +191,14 @@ describe('Meteor.methods', function () { firstThreadMessage = (await sendSimpleMessage({ roomId: room._id, tmid: firstMessage._id })).body.message; }); - after(async () => { - await deleteRoom({ type: 'p', roomId: room._id }); - await deleteUser(user); - }); + after(() => + Promise.all([ + deleteRoom({ type: 'p', roomId: room._id }), + deleteUser(user), + updateSetting('Message_Read_Receipt_Enabled', false), + updateSetting('Message_Read_Receipt_Store_Users', false), + ]), + ); describe('simple message and thread that nobody has read yet', () => { it("should return only the sender's read receipt for a message sent in the main room", async () => { @@ -508,6 +513,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should fail if not logged in', (done) => { request .post(methodCall('getMessages')) @@ -667,6 +674,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should not change the _updatedAt value when nothing is changed on the room', async () => { const roomBefore = await request.get(api('groups.info')).set(credentials).query({ roomId: rid, @@ -792,6 +801,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should fail if not logged in', (done) => { request .post(methodCall('loadHistory')) @@ -1008,6 +1019,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should fail if not logged in', (done) => { request .post(methodCall('loadNextMessages')) @@ -1186,6 +1199,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => Promise.all([deleteRoom({ type: 'p', roomId: rid }), deleteUser(testUser)])); + it('should fail if not logged in', (done) => { request .post(methodCall('getUsersOfRoom')) @@ -1491,6 +1506,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should fail if not logged in', (done) => { request .post(methodCall('loadMissedMessages')) @@ -1684,6 +1701,14 @@ describe('Meteor.methods', function () { $date: 0, }; + after(() => + Promise.all([ + updatePermission('view-privileged-setting', ['admin']), + updatePermission('edit-privileged-setting', ['admin']), + updatePermission('manage-selected-settings', ['admin']), + ]), + ); + it('should fail if not logged in', (done) => { request .post(methodCall('private-settings:get')) @@ -1895,6 +1920,8 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => deleteRoom({ type: 'p', roomId: rid })); + it('should send a message', (done) => { request .post(methodCall('sendMessage')) @@ -2044,6 +2071,14 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => + Promise.all([ + deleteRoom({ type: 'p', roomId: rid }), + updatePermission('bypass-time-limit-edit-and-delete', ['bot', 'app']), + updateSetting('Message_AllowEditing_BlockEditInMinutes', 0), + ]), + ); + it('should update a message with a URL', (done) => { request .post(methodCall('updateMessage')) @@ -2261,6 +2296,14 @@ describe('Meteor.methods', function () { .end(done); }); + after(() => + Promise.all([ + deleteRoom({ type: 'p', roomId: rid }), + updatePermission('bypass-time-limit-edit-and-delete', ['bot', 'app']), + updateSetting('Message_AllowEditing_BlockEditInMinutes', 0), + ]), + ); + it('should delete a message', (done) => { request .post(methodCall('deleteMessage')) @@ -2322,50 +2365,14 @@ describe('Meteor.methods', function () { describe('[@setUserActiveStatus]', () => { let testUser; let testUser2; - const testUserCredentials = {}; + let testUserCredentials; let dmId; let dmTestId; - before('create test user', (done) => { - const username = `user.test.${Date.now()}`; - const email = `${username}@rocket.chat`; - request - .post(api('users.create')) - .set(credentials) - .send({ email, name: username, username, password: username, roles: ['user'] }) - .end((err, res) => { - testUser = res.body.user; - done(); - }); - }); - - before('create test user 2', (done) => { - const username = `user.test.${Date.now()}`; - const email = `${username}@rocket.chat`; - request - .post(api('users.create')) - .set(credentials) - .send({ email, name: username, username, password: username, roles: ['user'] }) - .end((err, res) => { - testUser2 = res.body.user; - done(); - }); - }); - - before('login testUser', (done) => { - request - .post(api('login')) - .send({ - user: testUser.username, - password: testUser.username, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testUserCredentials['X-Auth-Token'] = res.body.data.authToken; - testUserCredentials['X-User-Id'] = res.body.data.userId; - }) - .end(done); + before(async () => { + testUser = await createUser(); + testUser2 = await createUser(); + testUserCredentials = await login(testUser.username, password); }); before('create direct conversation with user', (done) => { @@ -2412,6 +2419,15 @@ describe('Meteor.methods', function () { }); }); + after(() => + Promise.all([ + deleteRoom({ type: 'd', roomId: dmId }), + deleteRoom({ type: 'd', roomId: dmTestId }), + deleteUser(testUser), + deleteUser(testUser2), + ]), + ); + it('should deactivate a user', (done) => { request .post(methodCall('setUserActiveStatus')) @@ -2517,7 +2533,7 @@ describe('Meteor.methods', function () { .post(api('login')) .send({ user: testUser.username, - password: testUser.username, + password, }) .expect('Content-Type', 'application/json') .expect(200) @@ -2612,6 +2628,7 @@ describe('Meteor.methods', function () { let guestUser; let user; let room; + let createdRooms = []; before(async () => { guestUser = await createUser({ roles: ['guest'] }); @@ -2622,12 +2639,11 @@ describe('Meteor.methods', function () { name: `channel.test.${Date.now()}-${Math.random()}`, }) ).body.channel; + createdRooms.push(room); }); - after(async () => { - await deleteUser(user); - await deleteUser(guestUser); - user = undefined; - }); + after(() => + Promise.all([...createdRooms.map((r) => deleteRoom({ type: 'c', roomId: r._id })), deleteUser(user), deleteUser(guestUser)]), + ); it('should fail if not logged in', (done) => { request @@ -2693,7 +2709,7 @@ describe('Meteor.methods', function () { }), ); } - await Promise.all(promises); + createdRooms = [...createdRooms, ...(await Promise.all(promises)).map((res) => res.body.channel)]; request .post(methodCall('addUsersToRoom')) @@ -2739,6 +2755,8 @@ describe('Meteor.methods', function () { testUserCredentials = await login(testUser.username, testUser.username); }); + after(() => Promise.all([deleteRoom({ type: 'c', roomId: rid }), deleteUser(testUser)])); + describe('-> standard room', () => { describe('- when muting a user in a standard room', () => { it('should mute an user in a standard room', async () => { From d62505df2cde058bb8e3af951b1fd6d95b41f4b8 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Thu, 15 Feb 2024 15:36:00 -0300 Subject: [PATCH 3/8] fix: User presence not updating (#31723) Co-authored-by: dougfabris --- .changeset/large-toys-matter.md | 5 +++++ apps/meteor/app/notifications/client/index.ts | 1 + apps/meteor/app/notifications/client/lib/Presence.ts | 4 +++- apps/meteor/client/importPackages.ts | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/large-toys-matter.md create mode 100644 apps/meteor/app/notifications/client/index.ts diff --git a/.changeset/large-toys-matter.md b/.changeset/large-toys-matter.md new file mode 100644 index 000000000000..5dae3df44a46 --- /dev/null +++ b/.changeset/large-toys-matter.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed an issue with the user presence not updating automatically for other users. diff --git a/apps/meteor/app/notifications/client/index.ts b/apps/meteor/app/notifications/client/index.ts new file mode 100644 index 000000000000..47c2de413740 --- /dev/null +++ b/apps/meteor/app/notifications/client/index.ts @@ -0,0 +1 @@ +import './lib/Presence'; diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index 3cfc98c440c2..8cff2ed84f61 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -8,6 +8,8 @@ import { Presence } from '../../../../client/lib/presence'; new Meteor.Streamer('user-presence'); -Meteor.StreamerCentral.on('stream-user-presence', (uid: string, username: string, statusChanged?: UserStatus, statusText?: string) => { +type args = [username: string, statusChanged?: UserStatus, statusText?: string]; + +Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { Presence.notify({ _id: uid, username, status: statusChanged, statusText }); }); diff --git a/apps/meteor/client/importPackages.ts b/apps/meteor/client/importPackages.ts index 5119f0bba191..ffc81c35a953 100644 --- a/apps/meteor/client/importPackages.ts +++ b/apps/meteor/client/importPackages.ts @@ -15,6 +15,7 @@ import '../app/iframe-login/client'; import '../app/lib/client'; import '../app/message-mark-as-unread/client'; import '../app/nextcloud/client'; +import '../app/notifications/client'; import '../app/otr/client'; import '../app/slackbridge/client'; import '../app/slashcommands-archiveroom/client'; From 16cb0eab0d164388c2b30f3d6612f8eb225a4bf3 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Thu, 15 Feb 2024 16:15:21 -0300 Subject: [PATCH 4/8] fix: Blinking UI colors when finishing a Livechat conversation. (#31752) Co-authored-by: Martin Schoeler <20868078+MartinSchoeler@users.noreply.github.com> --- .changeset/silver-chicken-learn.md | 5 +++++ packages/livechat/src/lib/room.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/silver-chicken-learn.md diff --git a/.changeset/silver-chicken-learn.md b/.changeset/silver-chicken-learn.md new file mode 100644 index 000000000000..3257849ba45c --- /dev/null +++ b/.changeset/silver-chicken-learn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +fixed livechat UI blinking different colors when the chat is finished diff --git a/packages/livechat/src/lib/room.js b/packages/livechat/src/lib/room.js index ad447726d9b0..1e4f975f1886 100644 --- a/packages/livechat/src/lib/room.js +++ b/packages/livechat/src/lib/room.js @@ -29,7 +29,9 @@ export const closeChat = async ({ transcriptRequested } = {}) => { if (clearLocalStorageWhenChatEnded) { // exclude UI-affecting flags - const { minimized, visible, undocked, expanded, businessUnit, ...initial } = initialState(); + const { iframe: currentIframe } = store.state; + const { minimized, visible, undocked, expanded, businessUnit, config, iframe, ...initial } = initialState(); + initial.iframe = { ...currentIframe, guest: {} }; await store.setState(initial); } From ab476e4ac070663553cbe860fa6ed383cbb6db72 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:31:51 -0300 Subject: [PATCH 5/8] fix: Custom OAuth not working if other login services are also enabled (#31753) --- .changeset/lucky-ducks-join.md | 5 +++++ apps/meteor/client/startup/customOAuth.ts | 2 +- apps/meteor/tests/e2e/config/global-setup.ts | 3 +++ .../tests/e2e/fixtures/addCustomOAuth.ts | 18 ++++++++++++++++ apps/meteor/tests/e2e/oauth.spec.ts | 21 +++++++++++++++++++ apps/meteor/tests/e2e/page-objects/auth.ts | 4 ++++ 6 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .changeset/lucky-ducks-join.md create mode 100644 apps/meteor/tests/e2e/fixtures/addCustomOAuth.ts diff --git a/.changeset/lucky-ducks-join.md b/.changeset/lucky-ducks-join.md new file mode 100644 index 000000000000..e64661b0841b --- /dev/null +++ b/.changeset/lucky-ducks-join.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed an issue where the login button for Custom OAuth services would not work if any non-custom login service was also available diff --git a/apps/meteor/client/startup/customOAuth.ts b/apps/meteor/client/startup/customOAuth.ts index 1b9060f84e3a..5796814444cf 100644 --- a/apps/meteor/client/startup/customOAuth.ts +++ b/apps/meteor/client/startup/customOAuth.ts @@ -7,7 +7,7 @@ Meteor.startup(() => { loginServices.onLoad((services) => { for (const service of services) { if (!('custom' in service && service.custom)) { - return; + continue; } new CustomOAuth(service.service, { diff --git a/apps/meteor/tests/e2e/config/global-setup.ts b/apps/meteor/tests/e2e/config/global-setup.ts index 6e2d750d5938..d273ffc83108 100644 --- a/apps/meteor/tests/e2e/config/global-setup.ts +++ b/apps/meteor/tests/e2e/config/global-setup.ts @@ -1,3 +1,4 @@ +import addCustomOAuth from '../fixtures/addCustomOAuth'; import injectInitialData from '../fixtures/inject-initial-data'; import insertApp from '../fixtures/insert-apps'; @@ -5,4 +6,6 @@ export default async function (): Promise { await injectInitialData(); await insertApp(); + + await addCustomOAuth(); } diff --git a/apps/meteor/tests/e2e/fixtures/addCustomOAuth.ts b/apps/meteor/tests/e2e/fixtures/addCustomOAuth.ts new file mode 100644 index 000000000000..10a80a7710a9 --- /dev/null +++ b/apps/meteor/tests/e2e/fixtures/addCustomOAuth.ts @@ -0,0 +1,18 @@ +import { request } from '@playwright/test'; + +import { BASE_API_URL } from '../config/constants'; +import { Users } from './userStates'; + +export default async function addCustomOAuth(): Promise { + const api = await request.newContext(); + + const headers = { + 'X-Auth-Token': Users.admin.data.loginToken, + 'X-User-Id': Users.admin.data.username, + }; + + await api.post(`${BASE_API_URL}/settings.addCustomOAuth`, { data: { name: 'Test' }, headers }); + await api.post(`${BASE_API_URL}/settings/Accounts_OAuth_Custom-Test`, { data: { value: false }, headers }); + await api.post(`${BASE_API_URL}/settings/Accounts_OAuth_Custom-Test-url`, { data: { value: 'https://rocket.chat' }, headers }); + await api.post(`${BASE_API_URL}/settings/Accounts_OAuth_Custom-Test-login_style`, { data: { value: 'redirect' }, headers }); +} diff --git a/apps/meteor/tests/e2e/oauth.spec.ts b/apps/meteor/tests/e2e/oauth.spec.ts index 8d53fa9503b4..c93dc5a4f7db 100644 --- a/apps/meteor/tests/e2e/oauth.spec.ts +++ b/apps/meteor/tests/e2e/oauth.spec.ts @@ -19,6 +19,19 @@ test.describe('OAuth', () => { await expect(poRegistration.btnLoginWithGoogle).toBeVisible(); }); + await test.step('expect Custom OAuth button to be visible', async () => { + await expect((await setSettingValueById(api, 'Accounts_OAuth_Custom-Test', true)).status()).toBe(200); + await page.waitForTimeout(5000); + await page.goto('/home'); + + await expect(poRegistration.btnLoginWithCustomOAuth).toBeVisible(); + }); + + await test.step('expect redirect to the configured URL.', async () => { + await poRegistration.btnLoginWithCustomOAuth.click(); + await expect(page).toHaveURL(/https\:\/\/(www)?\.rocket\.chat/); + }); + await test.step('expect OAuth button to not be visible', async () => { await expect((await setSettingValueById(api, 'Accounts_OAuth_Google', false)).status()).toBe(200); await page.waitForTimeout(5000); @@ -26,5 +39,13 @@ test.describe('OAuth', () => { await page.goto('/home'); await expect(poRegistration.btnLoginWithGoogle).not.toBeVisible(); }); + + await test.step('expect Custom OAuth button to not be visible', async () => { + await expect((await setSettingValueById(api, 'Accounts_OAuth_Custom-Test', false)).status()).toBe(200); + await page.waitForTimeout(5000); + + await page.goto('/home'); + await expect(poRegistration.btnLoginWithCustomOAuth).not.toBeVisible(); + }); }); }); diff --git a/apps/meteor/tests/e2e/page-objects/auth.ts b/apps/meteor/tests/e2e/page-objects/auth.ts index 51290d46f9cc..8d5fe1edad20 100644 --- a/apps/meteor/tests/e2e/page-objects/auth.ts +++ b/apps/meteor/tests/e2e/page-objects/auth.ts @@ -27,6 +27,10 @@ export class Registration { return this.page.locator('role=button[name="Sign in with Google"]'); } + get btnLoginWithCustomOAuth(): Locator { + return this.page.locator('role=button[name="Sign in with Test"]'); + } + get goToRegister(): Locator { return this.page.locator('role=link[name="Create an account"]'); } From ab077230dac052e753c456054dc9829d4c93a8bc Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Thu, 15 Feb 2024 19:22:28 -0300 Subject: [PATCH 6/8] test: make push api tests fully independent (#31711) --- apps/meteor/tests/end-to-end/api/22-push.ts | 29 ++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/22-push.ts b/apps/meteor/tests/end-to-end/api/22-push.ts index f32651ea2ccf..7035260816d9 100644 --- a/apps/meteor/tests/end-to-end/api/22-push.ts +++ b/apps/meteor/tests/end-to-end/api/22-push.ts @@ -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 { updateSetting } from '../../data/permissions.helper'; @@ -193,11 +193,21 @@ describe('[Push]', function () { }); describe('[/push.info]', () => { - before(async () => { - await updateSetting('Push_enable', true); - await updateSetting('Push_enable_gateway', true); - await updateSetting('Push_gateway', 'https://random-gateway.rocket.chat'); - }); + before(() => + Promise.all([ + updateSetting('Push_enable', true), + updateSetting('Push_enable_gateway', true), + updateSetting('Push_gateway', 'https://random-gateway.rocket.chat'), + ]), + ); + + after(() => + Promise.all([ + updateSetting('Push_enable', true), + updateSetting('Push_enable_gateway', true), + updateSetting('Push_gateway', 'https://gateway.rocket.chat'), + ]), + ); it('should fail if not logged in', async () => { await request @@ -234,9 +244,10 @@ describe('[Push]', function () { }); describe('[/push.test]', () => { - before(async () => { - await updateSetting('Push_enable', false); - }); + before(() => updateSetting('Push_enable', false)); + + // TODO: Re-enable this test after fixing the issue with the push configure when enable/disable the setting + // after(() => updateSetting('Push_enable', true)); it('should fail if not logged in', async () => { await request From fe089ff9137505e8114d244aec054ecacf3ca9d4 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:09:34 -0300 Subject: [PATCH 7/8] ci: end-to-end tests breaking (#31789) --- apps/meteor/tests/e2e/fixtures/userStates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/tests/e2e/fixtures/userStates.ts b/apps/meteor/tests/e2e/fixtures/userStates.ts index f21405a94f02..860242d57693 100644 --- a/apps/meteor/tests/e2e/fixtures/userStates.ts +++ b/apps/meteor/tests/e2e/fixtures/userStates.ts @@ -15,7 +15,7 @@ export type IUserState = { }; function generateContext(username: string): IUserState { - const date = new Date('2023-02-17T20:38:12.306Z'); + const date = new Date(); date.setFullYear(date.getFullYear() + 1); const token = { From 1738e14f15cc932235bcf5f6acf20a01d5a91116 Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:20:26 +0530 Subject: [PATCH 8/8] regression: Reactions loader skeleton color (#31781) --- .../message/content/reactions/ReactionTooltip.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx b/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx index 6888233ac212..a71f50a953b6 100644 --- a/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx +++ b/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx @@ -77,10 +77,10 @@ const ReactionTooltip = ({ emojiName, usernames, mine, messageId, showRealName, if (isLoading) { return ( <> - - - {usernames.length > 5 && } - {usernames.length > 8 && } + + + {usernames.length > 5 && } + {usernames.length > 8 && } ); }