Skip to content

Commit

Permalink
Fix session widget tests
Browse files Browse the repository at this point in the history
Many things have broken without me noticing because of
a few broken tests.
  • Loading branch information
backspace committed Nov 14, 2024
1 parent 4dbf75f commit 1bf0adb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions waydowntown_app/test/widgets/session_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -73,6 +74,7 @@ void main() {
'http://example.com/fixme/session',
(server) => server.reply(200, {
'data': {
'id': '1',
'attributes': {'email': '[email protected]', 'admin': true}
}
}),
Expand All @@ -92,6 +94,8 @@ void main() {
expect(await secureStorage.read(key: 'user_email'),
equals('[email protected]'));
expect(await secureStorage.read(key: 'user_is_admin'), equals('true'));

expect(await UserService.getUserId(), equals('1'));
});

testWidgets(
Expand All @@ -105,6 +109,7 @@ void main() {
'http://example.com/fixme/session',
(server) => server.reply(200, {
'data': {
'id': '1',
'attributes': {'email': '[email protected]', 'admin': false}
}
}),
Expand Down Expand Up @@ -136,6 +141,7 @@ void main() {
'http://example.com/fixme/session',
(server) => server.reply(200, {
'data': {
'id': '1',
'attributes': {'email': '[email protected]'}
}
}),
Expand Down Expand Up @@ -207,6 +213,7 @@ void main() {
'http://example.com/fixme/session',
(server) => server.reply(200, {
'data': {
'id': '1',
'attributes': {'email': '[email protected]'}
}
}),
Expand Down

0 comments on commit 1bf0adb

Please sign in to comment.