-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-58259] [MM-58260] Move the /call end command to host controls #747
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2323675
move the /call end command to host controls
cpoile d1ba0b6
goimports
cpoile e2486bb
better data-testid; make selector more specific
cpoile c36aa8d
clean up test
cpoile 4935f50
test that second host can use /call end
cpoile 8934ce0
keep backward compatibility for mobile
cpoile 021ebc4
send end_call event when sessions = 0; refactor selectors
cpoile 9583d41
Merge branch 'main' into MM-58259-end-call
cpoile 79cff72
merge conflict
cpoile e39e8b2
simplify notification logic now we are always sending call_end action
cpoile 01088a7
Merge branch 'main' into MM-58259-end-call
cpoile b49ec0a
merge conflict
cpoile b710a15
remove mistaken async
cpoile 997e9ac
remove another unnecessary await
cpoile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Binary file modified
BIN
+500 Bytes
(120%)
...s.spec.ts-snapshots/call-incoming-condensed-notification-gm-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-141 Bytes
(98%)
...tifications.spec.ts-snapshots/call-incoming-notification-dm-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.47 KB
(120%)
...tifications.spec.ts-snapshots/call-incoming-notification-gm-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,52 @@ | ||
import {chromium, expect, test} from '@playwright/test'; | ||
import {readFile} from 'fs/promises'; | ||
|
||
import PlaywrightDevPage from '../page'; | ||
import {getUserIdxForTest, getUsernamesForTest, getUserStoragesForTest, joinCall, startCall} from '../utils'; | ||
|
||
const userStorages = getUserStoragesForTest(); | ||
const usernames = getUsernamesForTest(); | ||
|
||
test.beforeEach(async ({page, context}) => { | ||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.goto(); | ||
}); | ||
|
||
test.describe('slash commands', () => { | ||
const userIdx = getUserIdxForTest(); | ||
test.use({storageState: getUserStoragesForTest()[0]}); | ||
|
||
test('end call', async ({page}) => { | ||
const devPage = new PlaywrightDevPage(page); | ||
await devPage.startCall(); | ||
|
||
await expect(page.locator('#calls-widget')).toBeVisible(); | ||
await expect(page.getByTestId('calls-widget-loading-overlay')).toBeHidden(); | ||
|
||
await devPage.slashCallEnd(); | ||
|
||
// /call end cleans up all indicators of a running call | ||
await expect(page.locator('#calls-widget')).toBeHidden(); | ||
await expect(page.locator('#calls-channel-toast')).toBeHidden(); | ||
await expect(page.locator(`#sidebarItem_calls${userIdx}`).getByTestId('calls-sidebar-active-call-icon')).toBeHidden(); | ||
}); | ||
|
||
test('end call as second host', async () => { | ||
const user0Page = await startCall(userStorages[0]); | ||
const user1Page = await joinCall(userStorages[1]); | ||
|
||
await expect(user0Page.page.locator('#calls-widget')).toBeVisible(); | ||
await expect(user0Page.page.getByTestId('calls-widget-loading-overlay')).toBeHidden(); | ||
|
||
await user0Page.sendSlashCommand(`/call host @${usernames[1]}`); | ||
await user0Page.wait(1000); | ||
await user0Page.expectHostToBe(usernames[1]); | ||
|
||
await user1Page.slashCallEnd(); | ||
|
||
// /call end cleans up all indicators of a running call | ||
await expect(user0Page.page.locator('#calls-widget')).toBeHidden(); | ||
await expect(user0Page.page.locator('#calls-channel-toast')).toBeHidden(); | ||
await expect(user0Page.page.locator(`#sidebarItem_calls${userIdx}`).getByTestId('calls-sidebar-active-call-icon')).toBeHidden(); | ||
}); | ||
}); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting this because it's a big change. This is what we do in mobile and it seems to simplify things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implicitly thought we would handle this case server-side and send the unique call ID because this does not protect us against a race, as we still use the channel ID to figure out the locally stored call ID. It's not a huge deal, but it's something to note.