mirror of
https://github.com/hmalik144/easy_cc_flutter.git
synced 2025-12-10 03:05:34 +00:00
25 lines
857 B
Dart
25 lines
857 B
Dart
import 'package:easy_cc_flutter/views/converter_edit_text.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('MyWidget has a title and message', (tester) async {
|
|
// Create the widget by telling the tester to build it.
|
|
const hintText = "Test hint text";
|
|
const enterText = "some random text";
|
|
TextEditingController controller = TextEditingController();
|
|
final box = ConverterEditText(hintText, controller, (input) {
|
|
expect(find.text(input!), findsOneWidget);
|
|
});
|
|
await tester.pumpWidget(MaterialApp(
|
|
home: Material(child: box),
|
|
));
|
|
|
|
final hintFinder = find.text(hintText);
|
|
expect(hintFinder, findsOneWidget);
|
|
|
|
controller.text = enterText;
|
|
final textFinder = find.text(hintText);
|
|
expect(textFinder, findsOneWidget);
|
|
});
|
|
} |