TF-4233 Fix the response success check to use key presence instead of value nullness.

This commit is contained in:
dab246
2026-01-23 12:06:55 +07:00
committed by Dat H. Pham
parent 6551750bd2
commit 69c3d32e3c
10 changed files with 49 additions and 29 deletions
@@ -1,8 +1,8 @@
import 'package:core/presentation/views/text/text_field_builder.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:tmail_ui_user/features/base/widget/label_input_field_builder.dart';
import 'package:tmail_ui_user/features/labels/presentation/models/label_action_type.dart';
import 'package:tmail_ui_user/features/labels/presentation/widgets/create_new_label_modal.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import '../../base/core_robot.dart';
@@ -16,7 +16,11 @@ class CreateLabelModalRobot extends CoreRobot {
.enterText(name);
}
Future<void> tapSaveButton() async {
await $(CreateNewLabelModal).$(AppLocalizations().save).tap();
Future<void> tapPositiveActionButton(LabelActionType actionType) async {
if (actionType == LabelActionType.create) {
await $(CreateNewLabelModal).$(#create_label_button_action).tap();
} else {
await $(CreateNewLabelModal).$(#save_label_button_action).tap();
}
}
}
@@ -1,5 +1,6 @@
import 'package:core/utils/platform_info.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:tmail_ui_user/features/labels/presentation/models/label_action_type.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import '../../base/base_test_scenario.dart';
@@ -40,7 +41,7 @@ class EditATagScenario extends BaseTestScenario
const newLabelName = 'New edit tag 1';
await createLabelModalRobot.enterNewLabelName(newLabelName);
await createLabelModalRobot.tapSaveButton();
await createLabelModalRobot.tapPositiveActionButton(LabelActionType.edit);
await _expectLabelWithNewNameUpdated(newLabelName);
}