Skip to content

Commit 63daee6

Browse files
committed
test: update location mapping tests to use DateTime.timestamp()
1 parent 6a49a16 commit 63daee6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/stream_chat_persistence/test/src/mapper/location_mapper_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main() {
88
test('toLocation should map the entity into Location', () {
99
final createdAt = DateTime.now();
1010
final updatedAt = DateTime.now();
11-
final endAt = DateTime.now().add(const Duration(hours: 1));
11+
final endAt = DateTime.timestamp().add(const Duration(hours: 1));
1212

1313
final entity = LocationEntity(
1414
channelCid: 'testCid',
@@ -37,9 +37,9 @@ void main() {
3737
});
3838

3939
test('toEntity should map the Location into LocationEntity', () {
40-
final createdAt = DateTime.now();
41-
final updatedAt = DateTime.now();
42-
final endAt = DateTime.now().add(const Duration(hours: 1));
40+
final createdAt = DateTime.timestamp();
41+
final updatedAt = DateTime.timestamp();
42+
final endAt = DateTime.timestamp().add(const Duration(hours: 1));
4343

4444
final location = Location(
4545
channelCid: 'testCid',
@@ -68,9 +68,9 @@ void main() {
6868
});
6969

7070
test('roundtrip conversion should preserve data', () {
71-
final createdAt = DateTime.now();
72-
final updatedAt = DateTime.now();
73-
final endAt = DateTime.now().add(const Duration(hours: 1));
71+
final createdAt = DateTime.timestamp();
72+
final updatedAt = DateTime.timestamp();
73+
final endAt = DateTime.timestamp().add(const Duration(hours: 1));
7474

7575
final originalLocation = Location(
7676
channelCid: 'testCid',
@@ -100,7 +100,7 @@ void main() {
100100
});
101101

102102
test('should handle live location conversion', () {
103-
final endAt = DateTime.now().add(const Duration(hours: 1));
103+
final endAt = DateTime.timestamp().add(const Duration(hours: 1));
104104
final location = Location(
105105
channelCid: 'testCid',
106106
userId: 'testUserId',

0 commit comments

Comments
 (0)