feat(personalized_feed): added video and multiple images handling to detailed blog post screen

This commit is contained in:
misha
2026-07-22 14:41:26 +03:00
parent dcf7b25989
commit 2cccc9e253
17 changed files with 595 additions and 246 deletions

View File

@@ -6,6 +6,8 @@ import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import '../../../../fixtures/feed_fixtures.dart';
class MockFeedRepository extends Mock implements FeedRepository {}
void main() {
@@ -29,21 +31,7 @@ void main() {
test('getBlogPost - успешная загрузка поста', () async {
const postId = 1;
final mockPost = FeedBlogPostModel(
id: postId,
title: 'Test Post',
state: 'active',
image: '',
description: 'Test Content',
videoUrl: '',
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
totalLikes: 0,
totalViews: 0,
totalComments: 0,
wasLikedByMe: false,
author: const Author(authorName: 'Test Author', authorSlug: 'test-author', authorProfileIcon: '', authorIsMe: false),
);
final mockPost = FeedFixtures.feedBlogPostModel();
when(() => mockRepository.getBlogPost(id: postId)).thenAnswer((_) async => mockPost);
@@ -51,6 +39,8 @@ void main() {
expect(cubit.state.isLoading, false);
expect(cubit.state.blogPostModel, mockPost);
expect(cubit.state.blogPostModel?.images, hasLength(2));
expect(cubit.state.blogPostModel?.videoEmbedUrl, contains('rutube.ru/play/embed'));
verify(() => mockRepository.getBlogPost(id: postId)).called(1);
});