Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Trim unused action options and redundant sheet tests

r4khul175a8c0c7f72
diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
index 0fff99150a..614b85cc67 100644
--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart
@@ -9,7 +9,6 @@ class SelectionActionButton extends StatelessWidget {
final VoidCallback? onTap;
final bool shouldShow;
final bool isCritical;
- final Color? color;
const SelectionActionButton({
required this.labelText,
@@ -18,7 +17,6 @@ class SelectionActionButton extends StatelessWidget {
this.iconWidget,
this.shouldShow = true,
this.isCritical = false,
- this.color,
super.key,
});
@@ -37,7 +35,6 @@ class SelectionActionButton extends StatelessWidget {
onTap: onTap,
iconWidget: iconWidget,
isCritical: isCritical,
- color: color,
)
: const SizedBox(height: 60),
),
@@ -51,14 +48,12 @@ class _Body extends StatefulWidget {
final Widget? iconWidget;
final VoidCallback? onTap;
final bool isCritical;
- final Color? color;
const _Body({
required this.labelText,
required this.onTap,
required this.isCritical,
this.hugeIcon,
this.iconWidget,
- this.color,
});
@override
@@ -77,7 +72,7 @@ class __BodyState extends State<_Body> {
final colors = components.ComponentTheme.colorsOf(context);
final foregroundColor = widget.isCritical
? colors.warning
- : widget.color ?? colors.textBase;
+ : colors.textBase;
final labelStyle = components.TextStyles.mini.copyWith(
color: foregroundColor,
);
diff --git a/mobile/apps/photos/test/ui/viewer/gallery/album_actions_sheet_test.dart b/mobile/apps/photos/test/ui/viewer/gallery/album_actions_sheet_test.dart
index beaee38188..b360257a54 100644
--- a/mobile/apps/photos/test/ui/viewer/gallery/album_actions_sheet_test.dart
+++ b/mobile/apps/photos/test/ui/viewer/gallery/album_actions_sheet_test.dart
@@ -7,10 +7,11 @@ import "package:photos/ui/viewer/gallery/hooks/album_actions_sheet.dart";
void main() {
group("showAlbumActionsSheet", () {
- testWidgets("keeps the destructive option last in the shelf", (
+ testWidgets("keeps the destructive tile last and returns its value", (
tester,
) async {
- await _pumpLauncher(tester, (_) {});
+ String? result;
+ await _pumpLauncher(tester, (value) => result = value);
await _openLauncher(tester);
final tilePositions = [
@@ -31,19 +32,10 @@ void main() {
),
isTrue,
);
- expect(find.text("Hide"), findsOneWidget);
- expect(find.text("Cast"), findsOneWidget);
- });
-
- testWidgets("returns the tapped row", (tester) async {
- String? result;
- await _pumpLauncher(tester, (value) => result = value);
- await _openLauncher(tester);
-
- await tester.tap(find.text("Hide"));
+ await tester.tap(find.text("Delete"));
await tester.pumpAndSettle();
- expect(result, "hide");
+ expect(result, "delete");
expect(find.byType(BottomSheetComponent), findsNothing);
});
@@ -67,17 +59,7 @@ void main() {
expect(tester.takeException(), isNull);
expect(result, "cast");
- });
-
- testWidgets("returns the tapped tile", (tester) async {
- String? result;
- await _pumpLauncher(tester, (value) => result = value);
- await _openLauncher(tester);
-
- await tester.tap(find.text("Delete"));
- await tester.pumpAndSettle();
-
- expect(result, "delete");
+ expect(find.byType(BottomSheetComponent), findsNothing);
});
});
}