File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -507,26 +507,17 @@ void main() {
507
507
testWidgets (
508
508
'FormBuilderValidators.creditCardExpirationDate' ,
509
509
(WidgetTester tester) => testValidations (tester, (context) {
510
+ final now = DateTime .now ();
511
+ final month = now.month.toString ().padLeft (2 , '0' );
512
+ final year = now.year.toString ().substring (2 );
510
513
final validator = FormBuilderValidators .creditCardExpirationDate ();
511
514
// Pass
512
- expect (validator ('12/23 ' ), isNull);
515
+ expect (validator ('$ month /$ year ' ), isNull);
513
516
// Fail
514
517
expect (validator ('13/23' ), isNotNull);
515
518
}),
516
519
);
517
520
518
- testWidgets (
519
- 'FormBuilderValidators.creditCardExpirationDateNotExpired' ,
520
- (WidgetTester tester) => testValidations (tester, (context) {
521
- final validator =
522
- FormBuilderValidators .creditCardExpirationDateNotExpired ();
523
- // Pass
524
- expect (validator ('12/30' ), isNull);
525
- // Fail
526
- expect (validator ('12/20' ), isNotNull);
527
- }),
528
- );
529
-
530
521
testWidgets (
531
522
'FormBuilderValidators.creditCardCVC' ,
532
523
(WidgetTester tester) => testValidations (tester, (context) {
You can’t perform that action at this time.
0 commit comments