@@ -19,7 +19,7 @@ void main() {
19
19
group ('PostBloc' , () {
20
20
const mockPosts = [Post (id: 1 , title: 'post title' , body: 'post body' )];
21
21
const extraMockPosts = [
22
- Post (id: 2 , title: 'post title' , body: 'post body' )
22
+ Post (id: 2 , title: 'post title' , body: 'post body' ),
23
23
];
24
24
25
25
late http.Client httpClient;
@@ -58,7 +58,7 @@ void main() {
58
58
build: () => PostBloc (httpClient: httpClient),
59
59
act: (bloc) => bloc.add (PostFetched ()),
60
60
expect: () => const < PostState > [
61
- PostState (status: PostStatus .success, posts: mockPosts)
61
+ PostState (status: PostStatus .success, posts: mockPosts),
62
62
],
63
63
verify: (_) {
64
64
verify (() => httpClient.get (_postsUrl (start: 0 ))).called (1 );
@@ -80,7 +80,7 @@ void main() {
80
80
..add (PostFetched ())
81
81
..add (PostFetched ()),
82
82
expect: () => const < PostState > [
83
- PostState (status: PostStatus .success, posts: mockPosts)
83
+ PostState (status: PostStatus .success, posts: mockPosts),
84
84
],
85
85
verify: (_) {
86
86
verify (() => httpClient.get (any ())).called (1 );
@@ -104,7 +104,7 @@ void main() {
104
104
bloc.add (PostFetched ());
105
105
},
106
106
expect: () => const < PostState > [
107
- PostState (status: PostStatus .success, posts: mockPosts)
107
+ PostState (status: PostStatus .success, posts: mockPosts),
108
108
],
109
109
verify: (_) {
110
110
verify (() => httpClient.get (any ())).called (1 );
@@ -145,7 +145,7 @@ void main() {
145
145
status: PostStatus .success,
146
146
posts: mockPosts,
147
147
hasReachedMax: true ,
148
- )
148
+ ),
149
149
],
150
150
verify: (_) {
151
151
verify (() => httpClient.get (_postsUrl (start: 1 ))).called (1 );
@@ -173,7 +173,7 @@ void main() {
173
173
PostState (
174
174
status: PostStatus .success,
175
175
posts: [...mockPosts, ...extraMockPosts],
176
- )
176
+ ),
177
177
],
178
178
verify: (_) {
179
179
verify (() => httpClient.get (_postsUrl (start: 1 ))).called (1 );
0 commit comments