Skip to content

Commit

Permalink
chore: add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vareversat committed Sep 9, 2023
1 parent 02addf7 commit 77b5e2e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/units/custom_extensions_tests.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:chabo/extensions/date_time_extension.dart';
import 'package:chabo/extensions/string_extension.dart';
import 'package:chabo/extensions/time_of_day_extension.dart';
import 'package:chabo/models/enums/day.dart';
import 'package:chabo/models/enums/time_format.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

Expand Down Expand Up @@ -109,5 +111,22 @@ void main() {
),
);
});

group('time_of_date', () {
test('toFormattedString - 12h', () {
const tod = TimeOfDay(
hour: 15,
minute: 0,
);
expect(tod.toFormattedString(TimeFormat.twelveHours), '3:00 PM');
});
test('toFormattedString - 24h', () {
const tod = TimeOfDay(
hour: 15,
minute: 0,
);
expect(tod.toFormattedString(TimeFormat.twentyFourHours), '15:00');
});
});
});
}

0 comments on commit 77b5e2e

Please sign in to comment.