refactor(tests): update model instantiation to use const for improved performance

This commit is contained in:
mso7nueh
2025-12-03 06:16:34 +03:00
parent d0becb9e11
commit f3d4478c65
15 changed files with 1840 additions and 27 deletions

View File

@@ -31,7 +31,7 @@ void main() {
test('getConsultants - успешная загрузка консультантов', () async {
final testConsultants = [
FeedConsultantModel(
const FeedConsultantModel(
slug: 'consultant-1',
name: 'Консультант 1',
description: 'Описание консультанта 1',
@@ -40,7 +40,7 @@ void main() {
badges: [],
ratingPlace: 1,
),
FeedConsultantModel(
const FeedConsultantModel(
slug: 'consultant-2',
name: 'Консультант 2',
description: 'Описание консультанта 2',

View File

@@ -28,9 +28,9 @@ void main() {
});
test('getFeedBlogPosts - успешное получение постов', () async {
final expectedModel = FeedBlogPostSettingsModel(
feedBlogPostList: const [],
meta: const Meta(
const expectedModel = FeedBlogPostSettingsModel(
feedBlogPostList: [],
meta: Meta(
currentPage: 1,
from: null,
lastPage: 1,
@@ -56,9 +56,9 @@ void main() {
test('getFeedBlogPosts - с запросом и страницей', () async {
const query = 'тест';
const page = 2;
final expectedModel = FeedBlogPostSettingsModel(
feedBlogPostList: const [],
meta: const Meta(
const expectedModel = FeedBlogPostSettingsModel(
feedBlogPostList: [],
meta: Meta(
currentPage: page,
from: null,
lastPage: 2,
@@ -117,7 +117,7 @@ void main() {
});
test('getRecipes - успешное получение рецептов', () async {
final expectedRecipes = const RecipesPagination(
const expectedRecipes = RecipesPagination(
recipesList: [],
);
@@ -131,10 +131,10 @@ void main() {
});
test('getDiets - успешное получение диет', () async {
final expectedDiets = DietsPagination(
data: const [],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(
const expectedDiets = DietsPagination(
data: [],
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(
currentPage: 1,
from: null,
lastPage: 1,
@@ -169,10 +169,10 @@ void main() {
});
test('getPlans - успешное получение планов', () async {
final expectedPlans = PlanPaginationModel(
data: const [],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(
const expectedPlans = PlanPaginationModel(
data: [],
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(
currentPage: 1,
from: null,
lastPage: 1,
@@ -210,10 +210,10 @@ void main() {
test('getBlogPostComments - успешное получение комментариев', () async {
const postId = '1';
final expectedComments = CommentModel(
const expectedComments = CommentModel(
data: [],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(
currentPage: 1,
from: null,
lastPage: 1,
@@ -278,10 +278,10 @@ void main() {
});
test('getConsultants - успешное получение консультантов', () async {
final expectedConsultants = FeedConsultantPaginationModel(
data: const [],
links: const Links(first: '', last: '', prev: null, next: null),
meta: const Meta(
const expectedConsultants = FeedConsultantPaginationModel(
data: [],
links: Links(first: '', last: '', prev: null, next: null),
meta: Meta(
currentPage: 1,
from: null,
lastPage: 1,