Skip to content

Commit

Permalink
Make test timezone resistant
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Jan 14, 2025
1 parent bf1f690 commit b2f3368
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/view/broadcast/broadcast_round_screen_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:http/testing.dart';
import 'package:intl/intl.dart';
import 'package:lichess_mobile/src/model/broadcast/broadcast.dart';
import 'package:lichess_mobile/src/model/common/id.dart';
import 'package:lichess_mobile/src/network/http.dart';
Expand Down Expand Up @@ -124,7 +125,11 @@ void main() {
// Load the overview
await tester.pump();

expect(find.text('Jan 10 - Jan 18'), findsOneWidget);
final startsAt = DateTime.fromMillisecondsSinceEpoch(1736526600000);
final endsAt = DateTime.fromMillisecondsSinceEpoch(1737189000000);
final f = DateFormat.MMMd();

expect(find.text('${f.format(startsAt)} - ${f.format(endsAt)}'), findsOneWidget);
expect(find.text('9-round Swiss'), findsOneWidget);
expect(find.text('90 min + 30 sec / move'), findsOneWidget);
expect(find.text('Seville, Spain'), findsOneWidget);
Expand Down

0 comments on commit b2f3368

Please sign in to comment.