forked from eatvio/eatvio_app
fix: analyzer issue
This commit is contained in:
@@ -23,7 +23,7 @@ void main() {
|
||||
const types = 'light,veg';
|
||||
const duration = 30;
|
||||
const sorting = 'name';
|
||||
final expected = DietsPagination(
|
||||
const expected = DietsPagination(
|
||||
data: [
|
||||
Diet(
|
||||
id: 1,
|
||||
@@ -32,10 +32,10 @@ void main() {
|
||||
image: 'https://someurl.com/img.jpg',
|
||||
duration: duration,
|
||||
state: DietState.active,
|
||||
type: const DietType(light: true, veg: false, carb: false, meat: false),
|
||||
type: DietType(light: true, veg: false, carb: false, meat: false),
|
||||
details: 'Test diet description',
|
||||
dailySchedule: {},
|
||||
author: const Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
|
||||
author: Author(authorSlug: '', authorName: '', authorProfileIcon: '', authorIsMe: false),
|
||||
totalLikes: 1,
|
||||
totalViews: 1,
|
||||
totalComments: 1,
|
||||
@@ -44,8 +44,8 @@ void main() {
|
||||
dailyNutrition: [],
|
||||
),
|
||||
],
|
||||
links: const Links(first: '', last: '', prev: null, next: null),
|
||||
meta: const Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
);
|
||||
|
||||
when(
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
|
||||
test('getDiets returns pagination with minimal parameters', () async {
|
||||
const page = 1;
|
||||
final expected = DietsPagination(
|
||||
const expected = DietsPagination(
|
||||
data: [
|
||||
Diet(
|
||||
id: 2,
|
||||
@@ -71,10 +71,10 @@ void main() {
|
||||
image: 'https://someurl.com/img2.jpg',
|
||||
duration: 14,
|
||||
state: DietState.draft,
|
||||
type: const DietType(light: false, veg: true, carb: false, meat: false),
|
||||
type: DietType(light: false, veg: true, carb: false, meat: false),
|
||||
details: '',
|
||||
dailySchedule: {},
|
||||
author: const Author(authorSlug: 'author-slug', authorName: 'Author Name', authorProfileIcon: '', authorIsMe: true),
|
||||
author: Author(authorSlug: 'author-slug', authorName: 'Author Name', authorProfileIcon: '', authorIsMe: true),
|
||||
totalLikes: 5,
|
||||
totalViews: 10,
|
||||
totalComments: 2,
|
||||
@@ -83,8 +83,8 @@ void main() {
|
||||
dailyNutrition: [],
|
||||
),
|
||||
],
|
||||
links: const Links(first: '', last: '', prev: null, next: null),
|
||||
meta: const Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
);
|
||||
|
||||
when(mockMyDietsService.getDiets(page: page, query: null, state: null, types: null, duration: null, sorting: null)).thenAnswer((_) async => expected);
|
||||
@@ -102,10 +102,10 @@ void main() {
|
||||
const query = 'wellness';
|
||||
const state = 'draft';
|
||||
const duration = 21;
|
||||
final expected = DietsPagination(
|
||||
const expected = DietsPagination(
|
||||
data: [],
|
||||
links: const Links(first: '', last: '', prev: null, next: null),
|
||||
meta: const Meta(currentPage: 2, lastPage: 2, total: 0, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(currentPage: 2, lastPage: 2, total: 0, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
);
|
||||
|
||||
when(
|
||||
@@ -123,7 +123,7 @@ void main() {
|
||||
test('getDiets returns pagination with state filter', () async {
|
||||
const page = 1;
|
||||
const state = 'active';
|
||||
final expected = DietsPagination(
|
||||
const expected = DietsPagination(
|
||||
data: [
|
||||
Diet(
|
||||
id: 3,
|
||||
@@ -132,10 +132,10 @@ void main() {
|
||||
image: 'https://someurl.com/img3.jpg',
|
||||
duration: 7,
|
||||
state: DietState.active,
|
||||
type: const DietType(light: true, veg: true, carb: false, meat: false),
|
||||
type: DietType(light: true, veg: true, carb: false, meat: false),
|
||||
details: 'Active diet description',
|
||||
dailySchedule: {},
|
||||
author: const Author(authorSlug: 'author-2', authorName: 'Author 2', authorProfileIcon: '', authorIsMe: false),
|
||||
author: Author(authorSlug: 'author-2', authorName: 'Author 2', authorProfileIcon: '', authorIsMe: false),
|
||||
totalLikes: 10,
|
||||
totalViews: 20,
|
||||
totalComments: 5,
|
||||
@@ -144,8 +144,8 @@ void main() {
|
||||
dailyNutrition: [],
|
||||
),
|
||||
],
|
||||
links: const Links(first: '', last: '', prev: null, next: null),
|
||||
meta: const Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
);
|
||||
|
||||
when(mockMyDietsService.getDiets(page: page, query: null, state: state, types: null, duration: null, sorting: null)).thenAnswer((_) async => expected);
|
||||
@@ -161,7 +161,7 @@ void main() {
|
||||
test('getDiets returns pagination with sorting parameter', () async {
|
||||
const page = 1;
|
||||
const sorting = 'duration';
|
||||
final expected = DietsPagination(
|
||||
const expected = DietsPagination(
|
||||
data: [
|
||||
Diet(
|
||||
id: 4,
|
||||
@@ -170,10 +170,10 @@ void main() {
|
||||
image: 'https://someurl.com/img4.jpg',
|
||||
duration: 60,
|
||||
state: DietState.personal,
|
||||
type: const DietType(light: false, veg: false, carb: true, meat: true),
|
||||
type: DietType(light: false, veg: false, carb: true, meat: true),
|
||||
details: 'Sorted diet description',
|
||||
dailySchedule: {},
|
||||
author: const Author(authorSlug: 'author-3', authorName: 'Author 3', authorProfileIcon: '', authorIsMe: false),
|
||||
author: Author(authorSlug: 'author-3', authorName: 'Author 3', authorProfileIcon: '', authorIsMe: false),
|
||||
totalLikes: 15,
|
||||
totalViews: 30,
|
||||
totalComments: 8,
|
||||
@@ -182,8 +182,8 @@ void main() {
|
||||
dailyNutrition: [],
|
||||
),
|
||||
],
|
||||
links: const Links(first: '', last: '', prev: null, next: null),
|
||||
meta: const Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(currentPage: 1, lastPage: 1, total: 1, perPage: 10, from: null, links: [Link(url: null, label: null, active: null)], to: null),
|
||||
);
|
||||
|
||||
when(mockMyDietsService.getDiets(page: page, query: null, state: null, types: null, duration: null, sorting: sorting)).thenAnswer((_) async => expected);
|
||||
|
||||
Reference in New Issue
Block a user