forked from eatvio/eatvio_app
feat(tests): menu, settings, remove icov, remove generated files from % tests
This commit is contained in:
4
test/fixtures/menu/blocked_users_empty_response.json
vendored
Normal file
4
test/fixtures/menu/blocked_users_empty_response.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"data": []
|
||||
}
|
||||
|
||||
39
test/fixtures/menu/blocked_users_response.json
vendored
Normal file
39
test/fixtures/menu/blocked_users_response.json
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Test User 1",
|
||||
"email": "test1@example.com",
|
||||
"phone_confirmation_state": "confirmed",
|
||||
"is_public_profile": true,
|
||||
"is_blocked_by_me": true,
|
||||
"is_blocked_by_author": false,
|
||||
"is_blocked_by_user": false,
|
||||
"is_entity_subscribed_by_me": false,
|
||||
"slug": "test-user-1",
|
||||
"profile_photo_url": "",
|
||||
"roles": ["user"],
|
||||
"badges": [],
|
||||
"subscriptions": [],
|
||||
"subscribers": []
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Test User 2",
|
||||
"email": "test2@example.com",
|
||||
"phone_confirmation_state": "confirmed",
|
||||
"is_public_profile": true,
|
||||
"is_blocked_by_me": true,
|
||||
"is_blocked_by_author": false,
|
||||
"is_blocked_by_user": false,
|
||||
"is_entity_subscribed_by_me": false,
|
||||
"slug": "test-user-2",
|
||||
"profile_photo_url": "",
|
||||
"roles": ["user"],
|
||||
"badges": [],
|
||||
"subscriptions": [],
|
||||
"subscribers": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
24
test/fixtures/menu/notification_settings_response.json
vendored
Normal file
24
test/fixtures/menu/notification_settings_response.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"new_updates_notification": true,
|
||||
"weight_measurements_notification": true,
|
||||
"is_email_notifications_enabled": true,
|
||||
"is_push_notifications_enabled": true,
|
||||
"diary_reminder_notifications": {
|
||||
"first_reminder": {
|
||||
"enabled": true,
|
||||
"local_time_hours": 9,
|
||||
"local_time_mins": 0
|
||||
},
|
||||
"second_reminder": {
|
||||
"enabled": true,
|
||||
"local_time_hours": 13,
|
||||
"local_time_mins": 0
|
||||
},
|
||||
"third_reminder": {
|
||||
"enabled": false,
|
||||
"local_time_hours": 18,
|
||||
"local_time_mins": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
test/fixtures/menu/notification_settings_updated_response.json
vendored
Normal file
24
test/fixtures/menu/notification_settings_updated_response.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"new_updates_notification": false,
|
||||
"weight_measurements_notification": true,
|
||||
"is_email_notifications_enabled": true,
|
||||
"is_push_notifications_enabled": false,
|
||||
"diary_reminder_notifications": {
|
||||
"first_reminder": {
|
||||
"enabled": true,
|
||||
"local_time_hours": 9,
|
||||
"local_time_mins": 0
|
||||
},
|
||||
"second_reminder": {
|
||||
"enabled": true,
|
||||
"local_time_hours": 13,
|
||||
"local_time_mins": 0
|
||||
},
|
||||
"third_reminder": {
|
||||
"enabled": false,
|
||||
"local_time_hours": 18,
|
||||
"local_time_mins": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
45
test/fixtures/menu_fixtures.dart
vendored
Normal file
45
test/fixtures/menu_fixtures.dart
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:eatvio_app/features/menu/models/blocked_users_model.dart';
|
||||
import 'package:eatvio_app/features/menu/models/notification_settings_model.dart';
|
||||
import 'package:eatvio_app/features/profile/models/profile_model.dart';
|
||||
import 'fixture_reader.dart';
|
||||
|
||||
class MenuFixtures {
|
||||
MenuFixtures._();
|
||||
|
||||
static BlockedUsersModel blockedUsersModel() {
|
||||
return BlockedUsersModel.fromJson(
|
||||
FixtureReader.readAsMap('menu/blocked_users_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static BlockedUsersModel blockedUsersEmptyModel() {
|
||||
return BlockedUsersModel.fromJson(
|
||||
FixtureReader.readAsMap('menu/blocked_users_empty_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static List<ProfileModel> blockedUsersList() {
|
||||
return blockedUsersModel().profilesList;
|
||||
}
|
||||
|
||||
static List<ProfileModel> blockedUsersEmptyList() {
|
||||
return blockedUsersEmptyModel().profilesList;
|
||||
}
|
||||
|
||||
static ProfileModel blockedUser() {
|
||||
return blockedUsersList().first;
|
||||
}
|
||||
|
||||
static NotificationSettingsModel notificationSettingsModel() {
|
||||
return NotificationSettingsModel.fromJson(
|
||||
FixtureReader.readAsMap('menu/notification_settings_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static NotificationSettingsModel notificationSettingsUpdatedModel() {
|
||||
return NotificationSettingsModel.fromJson(
|
||||
FixtureReader.readAsMap('menu/notification_settings_updated_response.json'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
8
test/fixtures/settings/oauth_accounts_response.json
vendored
Normal file
8
test/fixtures/settings/oauth_accounts_response.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"vk": null,
|
||||
"yandex": null
|
||||
}
|
||||
}
|
||||
|
||||
14
test/fixtures/settings/oauth_accounts_with_data_response.json
vendored
Normal file
14
test/fixtures/settings/oauth_accounts_with_data_response.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"vk": {
|
||||
"oauth_id": "123456",
|
||||
"name": "Test User",
|
||||
"email": "test@example.com",
|
||||
"phone": "+79991234567",
|
||||
"linked_at": "2024-01-01T00:00:00Z"
|
||||
},
|
||||
"yandex": null
|
||||
}
|
||||
}
|
||||
|
||||
8
test/fixtures/settings/profile_settings_response.json
vendored
Normal file
8
test/fixtures/settings/profile_settings_response.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"new_updates_notifications": null,
|
||||
"diary_reminder_notifications": null,
|
||||
"is_mood_fillable": true,
|
||||
"is_bedtime_fillable": true,
|
||||
"is_public_profile": true
|
||||
}
|
||||
|
||||
8
test/fixtures/settings/profile_settings_updated_response.json
vendored
Normal file
8
test/fixtures/settings/profile_settings_updated_response.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"new_updates_notifications": null,
|
||||
"diary_reminder_notifications": null,
|
||||
"is_mood_fillable": false,
|
||||
"is_bedtime_fillable": false,
|
||||
"is_public_profile": false
|
||||
}
|
||||
|
||||
45
test/fixtures/settings_fixtures.dart
vendored
Normal file
45
test/fixtures/settings_fixtures.dart
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:eatvio_app/features/profile/models/profile_model.dart';
|
||||
import 'package:eatvio_app/features/settings/models/oauth_account_model.dart';
|
||||
import 'package:eatvio_app/features/settings/models/profile_settings_model.dart';
|
||||
import 'fixture_reader.dart';
|
||||
|
||||
class SettingsFixtures {
|
||||
SettingsFixtures._();
|
||||
|
||||
static ProfileSettingsModel profileSettingsModel() {
|
||||
return ProfileSettingsModel.fromJson(
|
||||
FixtureReader.readAsMap('settings/profile_settings_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static ProfileSettingsModel profileSettingsUpdatedModel() {
|
||||
return ProfileSettingsModel.fromJson(
|
||||
FixtureReader.readAsMap('settings/profile_settings_updated_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static ProfileDetailsModel profileDetailsModel() {
|
||||
return ProfileDetailsModel.fromJson(
|
||||
FixtureReader.readAsMap('profile/profile_details_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static ProfileModel profileModel() {
|
||||
return ProfileModel.fromJson(
|
||||
FixtureReader.readAsMap('profile/my_profile_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static OAuthAccountsResponseModel oauthAccountsResponseModel() {
|
||||
return OAuthAccountsResponseModel.fromJson(
|
||||
FixtureReader.readAsMap('settings/oauth_accounts_response.json'),
|
||||
);
|
||||
}
|
||||
|
||||
static OAuthAccountsResponseModel oauthAccountsWithDataResponseModel() {
|
||||
return OAuthAccountsResponseModel.fromJson(
|
||||
FixtureReader.readAsMap('settings/oauth_accounts_with_data_response.json'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user