implemented comprehensive accessibility (A11y) support across the app
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:marianum_mobile/widget/a11y/a11y_labels.dart';
|
||||
import 'package:marianum_mobile/widget/app_progress_indicator.dart';
|
||||
|
||||
void main() {
|
||||
Widget wrap(Widget child) => MaterialApp(home: Scaffold(body: child));
|
||||
|
||||
testWidgets('trägt standardmäßig das Lade-Label an den Screenreader', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(wrap(const AppProgressIndicator.large()));
|
||||
|
||||
final indicator = tester.widget<CircularProgressIndicator>(
|
||||
find.byType(CircularProgressIndicator),
|
||||
);
|
||||
expect(indicator.semanticsLabel, A11yLabels.loading);
|
||||
});
|
||||
|
||||
testWidgets('reicht ein spezifisches Label durch', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
wrap(const AppProgressIndicator.small(semanticsLabel: 'Wird gesendet')),
|
||||
);
|
||||
|
||||
final indicator = tester.widget<CircularProgressIndicator>(
|
||||
find.byType(CircularProgressIndicator),
|
||||
);
|
||||
expect(indicator.semanticsLabel, 'Wird gesendet');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user