Remove Cupertino branches from Settings
Keep the Material-only settings implementation and its focused tests while preserving public cupertino parameters for later cleanup. This removes unreachable platform-specific widgets and test variants without changing the Material path.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_font_section.dart';
|
||||
@@ -29,19 +28,11 @@ class _Harness {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _pump(
|
||||
WidgetTester tester,
|
||||
_Harness harness, {
|
||||
bool cupertino = false,
|
||||
}) async {
|
||||
Future<void> _pump(WidgetTester tester, _Harness harness) async {
|
||||
final section = SingleChildScrollView(
|
||||
child: SettingsFontSection(controller: harness.fonts),
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
cupertino
|
||||
? CupertinoApp(home: CupertinoPageScaffold(child: section))
|
||||
: MaterialApp(home: Scaffold(body: section)),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: Scaffold(body: section)));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
@@ -102,28 +93,6 @@ void main() {
|
||||
expect(harness.fonts.family, 'Source Sans 3');
|
||||
});
|
||||
|
||||
testWidgets('Cupertino: the chosen row carries the checkmark', (
|
||||
tester,
|
||||
) async {
|
||||
final harness = _Harness();
|
||||
await _pump(tester, harness, cupertino: true);
|
||||
|
||||
expect(find.byType(RadioListTile<FontChoice>), findsNothing);
|
||||
expect(_familyOf(tester, AppFont.system), 'CupertinoSystemText');
|
||||
Finder check(AppFont font) => find.descendant(
|
||||
of: find.byKey(settingsFontKey(font)),
|
||||
matching: find.byIcon(CupertinoIcons.check_mark),
|
||||
);
|
||||
expect(check(AppFont.system), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('Inter'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(check(AppFont.system), findsNothing);
|
||||
expect(check(AppFont.inter), findsOneWidget);
|
||||
expect(harness.store.id, AppFont.inter.id);
|
||||
expect(harness.fonts.family, 'Inter');
|
||||
});
|
||||
|
||||
testWidgets('a failed save is said under the group', (tester) async {
|
||||
final harness = _Harness();
|
||||
harness.store.failSaves = true;
|
||||
|
||||
Reference in New Issue
Block a user