mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-22 16:37:43 +00:00

* chore: move to latest appflowy collab version * chore: filter mapping * chore: remove mutex folder * chore: cleanup borrow checker issues * chore: fixed flowy user crate compilation errors * chore: removed parking lot crate * chore: adjusting non locking approach * chore: remove with folder method * chore: fix folder manager * chore: fixed workspace database compilation errors * chore: initialize database plugins * chore: fix locks in flowy core * chore: remove supabase * chore: async traits * chore: add mutexes in dart ffi * chore: post rebase fixes * chore: remove supabase dart code * chore: fix deadlock * chore: fix page_id is empty * chore: use data source to init collab * chore: fix user awareness test * chore: fix database deadlock * fix: initialize user awareness * chore: fix open workspace test * chore: fix import csv * chore: fix update row meta deadlock * chore: fix document size test * fix: timestamp set/get type convert * fix: calculation * chore: revert Arc to Rc * chore: attach plugin to database and database row * chore: async get row * chore: clippy * chore: fix tauri build * chore: clippy * fix: duplicate view deadlock * chore: fmt * chore: tauri build --------- Co-authored-by: nathan <nathan@appflowy.io>
73 lines
2.2 KiB
Dart
73 lines
2.2 KiB
Dart
import 'package:appflowy/generated/locale_keys.g.dart';
|
|
import 'package:appflowy/user/presentation/screens/sign_in_screen/widgets/widgets.dart';
|
|
import 'package:appflowy/workspace/presentation/settings/pages/settings_account_view.dart';
|
|
import 'package:appflowy/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart';
|
|
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'util.dart';
|
|
|
|
extension AppFlowyAuthTest on WidgetTester {
|
|
Future<void> tapGoogleLoginInButton() async {
|
|
await tapButton(
|
|
find.byKey(const Key('signInWithGoogleButton')),
|
|
);
|
|
}
|
|
|
|
/// Requires being on the SettingsPage.account of the SettingsDialog
|
|
Future<void> logout() async {
|
|
final scrollable = find.findSettingsScrollable();
|
|
await scrollUntilVisible(
|
|
find.byType(SignInOutButton),
|
|
100,
|
|
scrollable: scrollable,
|
|
);
|
|
|
|
await tapButton(find.byType(SignInOutButton));
|
|
|
|
expectToSeeText(LocaleKeys.button_ok.tr());
|
|
await tapButtonWithName(LocaleKeys.button_ok.tr());
|
|
}
|
|
|
|
Future<void> tapSignInAsGuest() async {
|
|
await tapButton(find.byType(SignInAnonymousButtonV2));
|
|
}
|
|
|
|
void expectToSeeGoogleLoginButton() {
|
|
expect(find.byKey(const Key('signInWithGoogleButton')), findsOneWidget);
|
|
}
|
|
|
|
void assertSwitchValue(Finder finder, bool value) {
|
|
final Switch switchWidget = widget(finder);
|
|
final isSwitched = switchWidget.value;
|
|
assert(isSwitched == value);
|
|
}
|
|
|
|
void assertToggleValue(Finder finder, bool value) {
|
|
final Toggle switchWidget = widget(finder);
|
|
final isSwitched = switchWidget.value;
|
|
assert(isSwitched == value);
|
|
}
|
|
|
|
void assertAppFlowyCloudEnableSyncSwitchValue(bool value) {
|
|
assertToggleValue(
|
|
find.descendant(
|
|
of: find.byType(AppFlowyCloudEnableSync),
|
|
matching: find.byWidgetPredicate((widget) => widget is Toggle),
|
|
),
|
|
value,
|
|
);
|
|
}
|
|
|
|
Future<void> toggleEnableSync(Type syncButton) async {
|
|
final finder = find.descendant(
|
|
of: find.byType(syncButton),
|
|
matching: find.byWidgetPredicate((widget) => widget is Toggle),
|
|
);
|
|
|
|
await tapButton(finder);
|
|
}
|
|
}
|