Organize settings into retained topic tabs
This commit is contained in:
@@ -18,6 +18,7 @@ import 'package:pipelines_app/features/settings/settings_trust_warning.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_theme.dart';
|
||||
|
||||
import 'fake_channel.dart';
|
||||
import 'settings_topic_test_helper.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('groups start at the bar inset and stop at the reading width', (
|
||||
@@ -34,7 +35,7 @@ void main() {
|
||||
expect(rect.width, closeTo(settingsContentMaxWidth, 0.01));
|
||||
}
|
||||
// A header's text lines up with its rows' text.
|
||||
final header = tester.getRect(find.text('Connection'));
|
||||
final header = tester.getRect(find.text('Connection').last);
|
||||
expect(
|
||||
header.left,
|
||||
closeTo(settingsPageSidePadding + settingsRowInset, 0.01),
|
||||
@@ -65,23 +66,31 @@ void main() {
|
||||
}
|
||||
// The trust warning is the Connection group's footer, not a card.
|
||||
expect(find.byType(SettingsTrustWarning), findsOneWidget);
|
||||
final title = tester.widget<Text>(find.text('Connection'));
|
||||
final theme = Theme.of(tester.element(find.text('Connection')));
|
||||
final title = tester.widget<Text>(find.text('Connection').last);
|
||||
final theme = Theme.of(tester.element(find.text('Connection').last));
|
||||
expect(title.style?.color, theme.colorScheme.primary);
|
||||
});
|
||||
|
||||
testWidgets('content starts below the bar and scrolls behind it', (
|
||||
testWidgets('content starts below the bar and persistent topic tabs', (
|
||||
tester,
|
||||
) async {
|
||||
const barHeight = 72.0;
|
||||
await _pump(tester, topPadding: barHeight);
|
||||
|
||||
final first = tester.getRect(find.byType(SettingsGroup).first);
|
||||
expect(first.top, closeTo(barHeight + settingsPageTopPadding, 0.01));
|
||||
// No top SafeArea: the scroll view itself reaches the top edge.
|
||||
expect(
|
||||
tester.getRect(find.byKey(const ValueKey('settings.scroll'))).top,
|
||||
0,
|
||||
first.top,
|
||||
closeTo(
|
||||
barHeight +
|
||||
tester.getSize(find.byType(TabBar)).height +
|
||||
settingsPageTopPadding,
|
||||
0.01,
|
||||
),
|
||||
);
|
||||
// The topic selector stays above each page scroll view.
|
||||
expect(
|
||||
tester.getRect(find.byKey(const ValueKey('settings.scroll')).last).top,
|
||||
barHeight + tester.getSize(find.byType(TabBar)).height,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -117,8 +126,9 @@ void main() {
|
||||
addTearDown(notifications.dispose);
|
||||
await _pump(tester, notifications: notifications);
|
||||
|
||||
expect(find.text('Notifications'), findsOneWidget);
|
||||
expect(find.text('Connection'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Notifications');
|
||||
expect(find.text('Notifications'), findsNWidgets(2));
|
||||
expect(find.text('Connection').last, findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Cupertino keeps the compact secondary field label', (
|
||||
@@ -226,4 +236,5 @@ Future<void> _pump(
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user