9551eceaed
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
57 lines
1.7 KiB
Dart
57 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/rendering.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
|
|
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
|
|
|
List<BackdropKey?> _keys(WidgetTester tester) => tester.layers
|
|
.whereType<BackdropFilterLayer>()
|
|
.map((layer) => layer.backdropKey)
|
|
.toList();
|
|
|
|
void main() {
|
|
testWidgets('a bar\'s pieces share one backdrop read; the expanded title '
|
|
'reads its own', (tester) async {
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: Scaffold(
|
|
extendBodyBehindAppBar: true,
|
|
appBar: SegmentedBar(
|
|
title: 'Release train run',
|
|
subtitle: 'Run 7',
|
|
expandableTitle: true,
|
|
leading: const BackButton(),
|
|
actions: [
|
|
IconButton(icon: const Icon(Icons.more_vert), onPressed: () {}),
|
|
],
|
|
),
|
|
body: const SizedBox.expand(),
|
|
),
|
|
),
|
|
);
|
|
|
|
final pieces = _keys(tester);
|
|
expect(pieces, hasLength(3));
|
|
final shared = pieces.first;
|
|
expect(shared, isNotNull);
|
|
expect(pieces, everyElement(same(shared)));
|
|
|
|
await tester.tap(find.text('Release train run'));
|
|
await tester.pumpAndSettle();
|
|
final keys = _keys(tester);
|
|
expect(keys, hasLength(4));
|
|
final expanded = keys.where((k) => !identical(k, shared)).toList();
|
|
expect(expanded, hasLength(1));
|
|
expect(expanded.single, isNotNull);
|
|
});
|
|
|
|
testWidgets('a lone piece reads the backdrop on its own', (tester) async {
|
|
await tester.pumpWidget(
|
|
const MaterialApp(
|
|
home: Center(child: GlassPill(child: Text('Tabs'))),
|
|
),
|
|
);
|
|
expect(_keys(tester), [isNull]);
|
|
});
|
|
}
|