-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make call token extraction more robust
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
- Loading branch information
1 parent
d51f09e
commit 7ddd9aa
Showing
2 changed files
with
32 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
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,21 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import { extractCallTokenFromUrl } from '../../../../src/services/talkService' | ||
|
||
describe('services/talk test suite', () => { | ||
test.each([ | ||
['https://foo.bar/call/123abc456', '123abc456'], | ||
['https://foo.bar/call/123abc456/', '123abc456'], | ||
['https://foo.bar/call/123abc456/baz', undefined], | ||
['https://foo.bar/call/123abc456#', '123abc456'], | ||
['https://foo.bar/call/123abc456#/', '123abc456'], | ||
['https://foo.bar/call/123abc456#message_3074226', '123abc456'], | ||
['https://foo.bar/baz', undefined], | ||
['https://foo.bar/baz/bar', undefined], | ||
])('should extract a token from call url %s', (url, expected) => { | ||
expect(extractCallTokenFromUrl(url)).toBe(expected) | ||
}) | ||
}) |