Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: fix anon test (#6375)

Nathan.foood3362bf96a86
diff --git a/frontend/appflowy_flutter/integration_test/cloud/anon_user_continue_test.dart b/frontend/appflowy_flutter/integration_test/cloud/anon_user_continue_test.dart
index 00a02788da..0364eaab57 100644
--- a/frontend/appflowy_flutter/integration_test/cloud/anon_user_continue_test.dart
+++ b/frontend/appflowy_flutter/integration_test/cloud/anon_user_continue_test.dart
@@ -38,7 +38,7 @@ void main() {
cloudType: AuthenticatorType.appflowyCloudSelfHost,
);
- tester.expectToSeeText(LocaleKeys.signIn_loginStartWithAnonymous.tr());
+ await tester.tapContinousAnotherWay();
await tester.tapAnonymousSignInButton();
await tester.expectToSeeHomePageWithGetStartedPage();
@@ -75,18 +75,6 @@ void main() {
await tester.logout();
await tester.pumpAndSettle();
-
- // tap the continue as anonymous button
- await tester
- .tapButton(find.text(LocaleKeys.signIn_loginStartWithAnonymous.tr()));
- await tester.expectToSeeHomePage();
-
- // New anon user name
- await tester.openSettings();
- await tester.openSettingsPage(SettingsPage.account);
- final userNameInput =
- tester.widget(find.byType(AccountUserProfile)) as AccountUserProfile;
- expect(userNameInput.name, 'Me');
});
});
}
diff --git a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart b/frontend/appflowy_flutter/integration_test/shared/common_operations.dart
index d15a7731fe..2d0fba0e95 100644
--- a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart
+++ b/frontend/appflowy_flutter/integration_test/shared/common_operations.dart
@@ -57,6 +57,14 @@ extension CommonOperations on WidgetTester {
}
}
+ Future<void> tapContinousAnotherWay() async {
+ // local version
+ await tapButtonWithName(LocaleKeys.signIn_continueAnotherWay.tr());
+ if (Platform.isWindows) {
+ await pumpAndSettle(const Duration(milliseconds: 200));
+ }
+ }
+
/// Tap the + button on the home page.
Future<void> tapAddViewButton({
String name = gettingStarted,
diff --git a/frontend/appflowy_flutter/packages/appflowy_backend/lib/log.dart b/frontend/appflowy_flutter/packages/appflowy_backend/lib/log.dart
index 503eae47e2..c122d14b9c 100644
--- a/frontend/appflowy_flutter/packages/appflowy_backend/lib/log.dart
+++ b/frontend/appflowy_flutter/packages/appflowy_backend/lib/log.dart
@@ -12,6 +12,8 @@ class Log {
// ignore: unused_field
late Logger _logger;
+ bool _enabled = false;
+
Log() {
_logger = Logger(
printer: PrettyPrinter(
@@ -25,12 +27,14 @@ class Log {
);
}
+ static void enableFlutterLog() {
+ shared._enabled = true;
+ }
+
// Generic internal logging function to reduce code duplication
static void _log(Level level, int rustLevel, dynamic msg,
[dynamic error, StackTrace? stackTrace]) {
- final enableFlutterLog = false;
- // ignore: dead_code
- if (enableFlutterLog) {
+ if (shared._enabled) {
switch (level) {
case Level.info:
shared._logger.i(msg, stackTrace: stackTrace);