-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from nordeck/nic/fix/3461-changes_in_meeting_…
…details_updates_other_widgets PB-3461 changes in meeting details updates other widgets
- Loading branch information
Showing
7 changed files
with
81 additions
and
3 deletions.
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 @@ | ||
--- | ||
'@nordeck/matrix-meetings-bot': patch | ||
--- | ||
|
||
Provide a base32_room_id50 template parameter for widget urls that can for example be used to template the pad-id of Etherpad. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright 2023 Nordeck IT + Consulting GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { | ||
IEventContentParams, | ||
eventContentParams, | ||
} from '../src/IEventContentParams'; | ||
|
||
describe('EventContentParamsHelper', () => { | ||
test('should create an instance with room_id and title', () => { | ||
const params: IEventContentParams = eventContentParams.newInstance( | ||
'roomId123', | ||
'Sample Title', | ||
); | ||
|
||
expect(params.room_id).toBe('roomId123'); | ||
expect(params.title).toBe('Sample Title'); | ||
expect(params.base32_room_id).toBe('OJXW63KJMQYTEMY'); | ||
expect(params.base32_room_id50).toBe('OJXW63KJMQYTEMY'); | ||
expect(params.base32_room_id50?.length).toBeLessThanOrEqual(50); | ||
expect(params.uuid).toBeDefined(); | ||
}); | ||
|
||
test('should create an instance with undefined room_id and empty title', () => { | ||
const params: IEventContentParams = eventContentParams.newInstance( | ||
undefined, | ||
'', | ||
); | ||
|
||
expect(params.room_id).toBeUndefined(); | ||
expect(params.title).toBe(''); | ||
expect(params.base32_room_id).toBeUndefined(); | ||
expect(params.base32_room_id50).toBeUndefined(); | ||
expect(params.uuid).toBeDefined(); | ||
}); | ||
|
||
test('should truncate base32_room_id to 50 characters if longer', () => { | ||
const longRoomId = 'a'.repeat(60); // Create a roomId longer than 50 characters | ||
const params: IEventContentParams = eventContentParams.newInstance( | ||
longRoomId, | ||
'Sample Title', | ||
); | ||
|
||
expect(params.room_id).toBe(longRoomId); | ||
expect(params.title).toBe('Sample Title'); | ||
expect(params.base32_room_id).toBe( | ||
'MFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLB', | ||
); | ||
expect(params.base32_room_id50).toBe( | ||
'MFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMFQWCYLBMF', | ||
); | ||
expect(params.base32_room_id50?.length).toBe(50); // Ensure it's truncated to 50 characters | ||
expect(params.uuid).toBeDefined(); | ||
}); | ||
}); |
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