diff --git a/forui/test/src/flutter_test_config.dart b/forui/test/src/flutter_test_config.dart index b7dee8587..818379877 100644 --- a/forui/test/src/flutter_test_config.dart +++ b/forui/test/src/flutter_test_config.dart @@ -10,6 +10,11 @@ import 'threshold_file_comparator.dart'; const _kGoldenTestsThreshold = 0.5 / 100; Future testExecutable(FutureOr Function() testMain) async { + await configureGoldenTests(_kGoldenTestsThreshold); + await testMain(); +} + +Future configureGoldenTests(double threshold) async { TestWidgetsFlutterBinding.ensureInitialized(); final fontLoader = FontLoader('packages/forui/Inter'); @@ -31,6 +36,4 @@ Future testExecutable(FutureOr Function() testMain) async { _kGoldenTestsThreshold, ); } - - await testMain(); } diff --git a/forui/test/src/widgets/text_field/flutter_test_config.dart b/forui/test/src/widgets/text_field/flutter_test_config.dart new file mode 100644 index 000000000..a29864de6 --- /dev/null +++ b/forui/test/src/widgets/text_field/flutter_test_config.dart @@ -0,0 +1,10 @@ +import 'dart:async'; + +import '../../flutter_test_config.dart'; + +const _kGoldenTestsThreshold = 4 / 100; + +Future testExecutable(FutureOr Function() testMain) async { + await configureGoldenTests(_kGoldenTestsThreshold); + await testMain(); +} \ No newline at end of file diff --git a/forui/test/src/widgets/text_field_golden_test.dart b/forui/test/src/widgets/text_field/text_field_golden_test.dart similarity index 99% rename from forui/test/src/widgets/text_field_golden_test.dart rename to forui/test/src/widgets/text_field/text_field_golden_test.dart index 683e0d35b..09919642c 100644 --- a/forui/test/src/widgets/text_field_golden_test.dart +++ b/forui/test/src/widgets/text_field/text_field_golden_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:forui/forui.dart'; -import '../test_scaffold.dart'; +import '../../test_scaffold.dart'; const _longText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ' diff --git a/forui/test/src/widgets/text_field_test.dart b/forui/test/src/widgets/text_field/text_field_test.dart similarity index 97% rename from forui/test/src/widgets/text_field_test.dart rename to forui/test/src/widgets/text_field/text_field_test.dart index 74ec9fcd5..d29c77530 100644 --- a/forui/test/src/widgets/text_field_test.dart +++ b/forui/test/src/widgets/text_field/text_field_test.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:forui/forui.dart'; -import '../test_scaffold.dart'; +import '../../test_scaffold.dart'; void main() { group('FTextField', () {