We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 878755d commit 83bf0adCopy full SHA for 83bf0ad
packages/powersync/test/credentials_test.dart
@@ -0,0 +1,14 @@
1
+import 'package:powersync/powersync.dart';
2
+import 'package:test/test.dart';
3
+
4
+void main() {
5
+ group('PowerSyncCredentials', () {
6
+ test('getExpiryDate', () async {
7
+ // Specifically test a token with a "-" character and missing padding
8
+ final token =
9
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ9Pn0-YWIiLCJpYXQiOjE3MDc3Mzk0MDAsImV4cCI6MTcwNzczOTUwMH0=.IVoAtpJ7jfwLbqlyJGYHPCvljLis_fHj2Qvdqlj8AQU';
10
+ expect(PowerSyncCredentials.getExpiryDate(token)?.toUtc(),
11
+ equals(DateTime.parse('2024-02-12T12:05:00Z')));
12
+ });
13
14
+}
0 commit comments