refactor: MVC archive
This commit is contained in:
parent
ca70ec0240
commit
bff8a2629a
8 changed files with 88 additions and 27 deletions
20
test/utils/test_client.dart
Normal file
20
test/utils/test_client.dart
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/utils/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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue