-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: User status when setting "Use REST instead of websocket for Mete…
…or calls" is disabled (#32500)
- Loading branch information
1 parent
8e4485b
commit 19c131b
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': patch | ||
--- | ||
|
||
Fix user not being set as online when setting "Use REST instead of websocket for Meteor calls" is disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { DEFAULT_USER_CREDENTIALS, IS_EE } from './config/constants'; | ||
import { Registration } from './page-objects'; | ||
import { setSettingValueById } from './utils/setSettingValueById'; | ||
import { test, expect } from './utils/test'; | ||
|
||
test.describe.serial('Presence', () => { | ||
let poRegistration: Registration; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
poRegistration = new Registration(page); | ||
|
||
await page.goto('/home'); | ||
}); | ||
|
||
test.beforeAll(async ({ api }) => { | ||
await expect((await setSettingValueById(api, 'API_Use_REST_For_DDP_Calls', true)).status()).toBe(200); | ||
}); | ||
|
||
test.afterAll(async ({ api }) => { | ||
await expect((await setSettingValueById(api, 'API_Use_REST_For_DDP_Calls', true)).status()).toBe(200); | ||
}); | ||
|
||
test.describe('Login using default settings', () => { | ||
test('expect user to be online after log in', async ({ page }) => { | ||
await poRegistration.username.type('user1'); | ||
await poRegistration.inputPassword.type(DEFAULT_USER_CREDENTIALS.password); | ||
await poRegistration.btnLogin.click(); | ||
|
||
await expect(page.getByRole('button', { name: 'User menu' }).locator('.rcx-status-bullet--online')).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('Login using with "Methods by REST" disabled', () => { | ||
test.skip(IS_EE, `Micro services don't support turning this setting off`); | ||
|
||
test.beforeAll(async ({ api }) => { | ||
await expect((await setSettingValueById(api, 'API_Use_REST_For_DDP_Calls', false)).status()).toBe(200); | ||
}); | ||
|
||
test('expect user to be online after log in', async ({ page }) => { | ||
await poRegistration.username.type('user1'); | ||
await poRegistration.inputPassword.type(DEFAULT_USER_CREDENTIALS.password); | ||
await poRegistration.btnLogin.click(); | ||
|
||
await expect(page.getByRole('button', { name: 'User menu' }).locator('.rcx-status-bullet--online')).toBeVisible(); | ||
}); | ||
}); | ||
}); |