diff --git a/test/features/chat/repositories/chat_repository_test.dart b/test/features/chat/repositories/chat_repository_test.dart index 0fb35bf4..12e75a64 100644 --- a/test/features/chat/repositories/chat_repository_test.dart +++ b/test/features/chat/repositories/chat_repository_test.dart @@ -386,7 +386,7 @@ void main() { test('getChosenPlan - получает выбранный план', () async { const planId = 1; final chosenPlanFixture = FixtureReader.readAsMap( - 'chat/chosen_plan_response.json', + 'chat/chosen_plan/chosen_plan_in_progress_response.json', ); final expectedPlan = ChosenPlanModel.fromJson(chosenPlanFixture); diff --git a/test/features/chat/services/chat_service_test.dart b/test/features/chat/services/chat_service_test.dart index 68750a7e..bf55d616 100644 --- a/test/features/chat/services/chat_service_test.dart +++ b/test/features/chat/services/chat_service_test.dart @@ -238,7 +238,7 @@ void main() { test('getChosenPlan - возвращает выбранный план', () async { const planId = 1; final chosenPlanFixture = FixtureReader.readAsMap( - 'chat/chosen_plan_response.json', + 'chat/chosen_plan/chosen_plan_in_progress_response.json', ); final expectedPlan = ChosenPlanModel.fromJson(chosenPlanFixture); diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_canceled_by_the_initiator_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_canceled_by_the_initiator_response.json new file mode 100644 index 00000000..95cd055e --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_canceled_by_the_initiator_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "canceled_by_the_initiator", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_charge_was_callected_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_charge_was_callected_response.json new file mode 100644 index 00000000..8b105150 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_charge_was_callected_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "charge_was_collected", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_complained_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_complained_response.json new file mode 100644 index 00000000..afc390cf --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_complained_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "complained", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_confirmed_by_consultant_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_confirmed_by_consultant_response.json new file mode 100644 index 00000000..c5f7eac3 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_confirmed_by_consultant_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "confirmed_by_consultant", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_done_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_done_response.json new file mode 100644 index 00000000..a119dbaa --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_done_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "done", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_in_coordination_response.json similarity index 100% rename from test/fixtures/chat/chosen_plan_response.json rename to test/fixtures/chat/chosen_plan/chosen_plan_in_coordination_response.json diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_in_progress_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_in_progress_response.json new file mode 100644 index 00000000..f50410b9 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_in_progress_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "in_progress", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_initied_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_initied_response.json new file mode 100644 index 00000000..3c2773ba --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_initied_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "initied", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_last_day_finished_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_last_day_finished_response.json new file mode 100644 index 00000000..9c60bed1 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_last_day_finished_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "last_day_finished", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_last_day_started_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_last_day_started_response.json new file mode 100644 index 00000000..7e42fc0f --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_last_day_started_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "last_day_started", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_paid_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_paid_response.json new file mode 100644 index 00000000..e9c1fbd0 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_paid_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "paid", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_payment_failed_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_payment_failed_response.json new file mode 100644 index 00000000..7857a970 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_payment_failed_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "payment_failed", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_pending_payment_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_pending_payment_response.json new file mode 100644 index 00000000..9a1a8529 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_pending_payment_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "pending_payment", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_presonal_diet_set_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_presonal_diet_set_response.json new file mode 100644 index 00000000..317faa83 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_presonal_diet_set_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "personal_diet_setted", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_start_date_has_been_set_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_start_date_has_been_set_response.json new file mode 100644 index 00000000..d30e9b58 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_start_date_has_been_set_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "start_date_has_been_set", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} + diff --git a/test/fixtures/chat/chosen_plan/chosen_plan_started_response.json b/test/fixtures/chat/chosen_plan/chosen_plan_started_response.json new file mode 100644 index 00000000..fe3584e2 --- /dev/null +++ b/test/fixtures/chat/chosen_plan/chosen_plan_started_response.json @@ -0,0 +1,47 @@ +{ + "id": 1, + "option_type": "1", + "start_date": "2024-01-01T00:00:00Z", + "last_state": "started", + "chat_id": "chat-1", + "consultant_id": 1, + "plan": { + "id": 1, + "slug": "test-plan", + "name": "Test Plan", + "image": "https://example.com/plan.jpg", + "duration": 30, + "state": "active", + "type": { + "fit": true, + "slim": false, + "behavior": false, + "wellness": false + }, + "description_md": "Plan description", + "packets_count": 1, + "packet1_options": { + "items": ["Item 1", "Item 2"], + "price": 1500.0, + "short": "Option 1", + "description_md": "Description", + "has_personal_diet": false + }, + "packet2_options": null, + "packet3_options": null, + "author": { + "author_slug": "author-1", + "author_name": "Author Name", + "author_profile_icon": "https://example.com/author.jpg", + "author_is_me": false + }, + "total_likes": 10, + "total_views": 100, + "total_comments": 5, + "is_favorite": false, + "min_price_of_options": 1000.0, + "max_price_of_options": 2000.0, + "was_liked_by_me": false + } +} +