fix(app): polish glass diff and pipeline controls
This commit is contained in:
@@ -76,13 +76,10 @@ void _expectWholeLabel(WidgetTester tester, Finder finder, String label) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'patch typography preserves the native host style without overrides',
|
||||
() {
|
||||
const native = TextStyle(fontSize: 19, fontFamily: 'host-font');
|
||||
expect(nativeDiffText(native), same(native));
|
||||
},
|
||||
);
|
||||
test('patch typography uses the bundled fixed-width font', () {
|
||||
const native = TextStyle(fontSize: 19, fontFamily: 'host-font');
|
||||
expect(nativeDiffText(native), native.copyWith(fontFamily: 'RobotoMono'));
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'light and dark themes give additions and removals distinct hues',
|
||||
@@ -164,6 +161,14 @@ void main() {
|
||||
final added = spans.firstWhere((span) => span.text == '+2');
|
||||
final removed = spans.firstWhere((span) => span.text == '-2');
|
||||
expect(added.style!.color, isNot(removed.style!.color));
|
||||
expect(
|
||||
find.byWidgetPredicate((widget) {
|
||||
if (widget is! RichText || widget.text is! TextSpan) return false;
|
||||
return (widget.text as TextSpan).toPlainText() == '+2 -2';
|
||||
}),
|
||||
findsOneWidget,
|
||||
reason: 'the file header is the only visible line-count summary',
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('the raw view scrolls long lines instead of wrapping them', (
|
||||
|
||||
@@ -41,4 +41,25 @@ void main() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
testWidgets('wide scope control hugs its labels', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: SizedBox(
|
||||
width: 500,
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: PipelineScopeControl(scheduled: false, onSelected: (_) {}),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('pipeline-scope'))).width,
|
||||
lessThan(500),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -191,4 +191,30 @@ void main() {
|
||||
await tester.pumpWidget(app(true));
|
||||
expect(find.byType(BackdropFilter), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('Material and Cupertino titles use semibold text', (
|
||||
tester,
|
||||
) async {
|
||||
for (final cupertino in [false, true]) {
|
||||
await tester.pumpWidget(
|
||||
cupertino
|
||||
? const CupertinoApp(
|
||||
home: CupertinoPageScaffold(
|
||||
navigationBar: SegmentedBar(cupertino: true, title: 'Title'),
|
||||
child: SizedBox.expand(),
|
||||
),
|
||||
)
|
||||
: const MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: SegmentedBar(cupertino: false, title: 'Title'),
|
||||
body: SizedBox.expand(),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(
|
||||
tester.widget<Text>(find.text('Title')).style?.fontWeight,
|
||||
FontWeight.w600,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user