feat: Add scroll-to-event
This commit is contained in:
parent
8df3695ecf
commit
46c26c02dc
8 changed files with 269 additions and 76 deletions
31
test/matrix_identifier_string_extension_test.dart
Normal file
31
test/matrix_identifier_string_extension_test.dart
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fluffychat/utils/matrix_identifier_string_extension.dart';
|
||||
|
||||
void main() {
|
||||
group('Matrix Identifier String Extension', () {
|
||||
test('parseIdentifierIntoParts', () {
|
||||
var res = '#alias:beep'.parseIdentifierIntoParts();
|
||||
expect(res.roomIdOrAlias, '#alias:beep');
|
||||
expect(res.eventId, null);
|
||||
expect(res.queryString, null);
|
||||
res = 'blha'.parseIdentifierIntoParts();
|
||||
expect(res, null);
|
||||
res = '#alias:beep/\$event'.parseIdentifierIntoParts();
|
||||
expect(res.roomIdOrAlias, '#alias:beep');
|
||||
expect(res.eventId, '\$event');
|
||||
expect(res.queryString, null);
|
||||
res = '#alias:beep?blubb'.parseIdentifierIntoParts();
|
||||
expect(res.roomIdOrAlias, '#alias:beep');
|
||||
expect(res.eventId, null);
|
||||
expect(res.queryString, 'blubb');
|
||||
res = '#alias:beep/\$event?blubb'.parseIdentifierIntoParts();
|
||||
expect(res.roomIdOrAlias, '#alias:beep');
|
||||
expect(res.eventId, '\$event');
|
||||
expect(res.queryString, 'blubb');
|
||||
res = '#/\$?:beep/\$event?blubb?b'.parseIdentifierIntoParts();
|
||||
expect(res.roomIdOrAlias, '#/\$?:beep');
|
||||
expect(res.eventId, '\$event');
|
||||
expect(res.queryString, 'blubb?b');
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue