From 1bf0adb3bd33b5478a06aca50f4f4d82b5d59a78 Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Thu, 14 Nov 2024 15:17:25 -0600 Subject: [PATCH] Fix session widget tests Many things have broken without me noticing because of a few broken tests. --- waydowntown_app/test/widgets/session_widget_test.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/waydowntown_app/test/widgets/session_widget_test.dart b/waydowntown_app/test/widgets/session_widget_test.dart index 9364d46f..93ff36af 100644 --- a/waydowntown_app/test/widgets/session_widget_test.dart +++ b/waydowntown_app/test/widgets/session_widget_test.dart @@ -5,6 +5,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:http_mock_adapter/http_mock_adapter.dart'; import 'package:pretty_dio_logger/pretty_dio_logger.dart'; import 'package:waydowntown/refresh_token_interceptor.dart'; +import 'package:waydowntown/services/user_service.dart'; import 'package:waydowntown/widgets/session_widget.dart'; void main() { @@ -73,6 +74,7 @@ void main() { 'http://example.com/fixme/session', (server) => server.reply(200, { 'data': { + 'id': '1', 'attributes': {'email': 'test@example.com', 'admin': true} } }), @@ -92,6 +94,8 @@ void main() { expect(await secureStorage.read(key: 'user_email'), equals('test@example.com')); expect(await secureStorage.read(key: 'user_is_admin'), equals('true')); + + expect(await UserService.getUserId(), equals('1')); }); testWidgets( @@ -105,6 +109,7 @@ void main() { 'http://example.com/fixme/session', (server) => server.reply(200, { 'data': { + 'id': '1', 'attributes': {'email': 'test@example.com', 'admin': false} } }), @@ -136,6 +141,7 @@ void main() { 'http://example.com/fixme/session', (server) => server.reply(200, { 'data': { + 'id': '1', 'attributes': {'email': 'test@example.com'} } }), @@ -207,6 +213,7 @@ void main() { 'http://example.com/fixme/session', (server) => server.reply(200, { 'data': { + 'id': '1', 'attributes': {'email': 'test@example.com'} } }),