mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

This matches the naming pattern expected from package:test `flutter test` doesn't care, since it finds all _test.dart files and runs them regardless of directory. @Hixie
24 lines
684 B
Dart
24 lines
684 B
Dart
|
|
import 'package:test/test.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:stocks/main.dart' as stocks;
|
|
import 'package:stocks/stock_data.dart' as stock_data;
|
|
|
|
void main() {
|
|
stock_data.StockDataFetcher.actuallyFetchData = false;
|
|
|
|
test("Test changing locale", () {
|
|
testWidgets((WidgetTester tester) {
|
|
stocks.main();
|
|
tester.pump(const Duration(seconds: 1)); // Unclear why duration is required.
|
|
|
|
Element<Text> tab = tester.findText('MARKET');
|
|
expect(tab, isNotNull);
|
|
tester.setLocale("es", "US");
|
|
tester.pump();
|
|
expect(tab.widget.data, equals("MERCADO"));
|
|
});
|
|
});
|
|
}
|