mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 13:09:24 +01:00
21 lines
586 B
Dart
21 lines
586 B
Dart
import 'package:matrix/matrix.dart';
|
|
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/fluffy_client.dart';
|
|
|
|
Future<FluffyClient> testClient({
|
|
bool loggedIn = false,
|
|
String homeserver = 'https://fakeserver.notexisting',
|
|
String id = 'FluffyChat Widget Test',
|
|
}) async {
|
|
final client = FluffyClient(testMode: true);
|
|
if (homeserver != null) {
|
|
await client.checkHomeserver(homeserver);
|
|
}
|
|
if (loggedIn) {
|
|
await client.login(
|
|
identifier: AuthenticationUserIdentifier(user: '@alice:example.invalid'),
|
|
password: '1234',
|
|
);
|
|
}
|
|
return client;
|
|
}
|