aves_mio/.flutter/dev/a11y_assessments/test/snack_bar_test.dart
Fabio Micheluz 2c988f959b
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-02-19 13:25:23 +01:00

27 lines
1,014 B
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:a11y_assessments/use_cases/snack_bar.dart';
import 'package:flutter_test/flutter_test.dart';
import 'test_utils.dart';
void main() {
testWidgets('snack bar can run', (WidgetTester tester) async {
await pumpsUseCase(tester, SnackBarUseCase());
const snackBarText = 'Awesome Snackbar!';
expect(find.text(snackBarText), findsNothing);
await tester.tap(find.text('Show Snackbar'));
expect(find.text(snackBarText), findsNothing);
await tester.pump();
expect(find.text(snackBarText), findsOneWidget);
});
testWidgets('snack bar demo page has one h1 tag', (WidgetTester tester) async {
await pumpsUseCase(tester, SnackBarUseCase());
final Finder findHeadingLevelOnes = find.bySemanticsLabel('SnackBar Demo');
await tester.pumpAndSettle();
expect(findHeadingLevelOnes, findsOne);
});
}