Skip to content

Commit

Permalink
Increase threshold for textfield golden tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Jun 6, 2024
1 parent 9bc2607 commit 2f54f76
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 5 additions & 2 deletions forui/test/src/flutter_test_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import 'threshold_file_comparator.dart';
const _kGoldenTestsThreshold = 0.5 / 100;

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
await configureGoldenTests(_kGoldenTestsThreshold);
await testMain();
}

Future<void> configureGoldenTests(double threshold) async {
TestWidgetsFlutterBinding.ensureInitialized();

final fontLoader = FontLoader('packages/forui/Inter');
Expand All @@ -31,6 +36,4 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {
_kGoldenTestsThreshold,
);
}

await testMain();
}
10 changes: 10 additions & 0 deletions forui/test/src/widgets/text_field/flutter_test_config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'dart:async';

import '../../flutter_test_config.dart';

const _kGoldenTestsThreshold = 4 / 100;

Future<void> testExecutable(FutureOr<void> Function() testMain) async {
await configureGoldenTests(_kGoldenTestsThreshold);
await testMain();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () {
Expand Down

0 comments on commit 2f54f76

Please sign in to comment.