Skip to content

Commit acdf2a2

Browse files
committed
Change: Adjusted PagedListFilterBloc tests.
1 parent 1970ae6 commit acdf2a2

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

test/src/list/paged/paged_list_filter_bloc_test.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ void main() {
2525
bloc = PagedListFilterBloc<int, int>(repository);
2626
});
2727

28-
test('should emit list loaded empty when first page contains no elements',
28+
test('should emit [$Loading, $Empty] when first page contains no elements',
2929
() {
3030
when(loadingFirstPage);
3131
then(
3232
() => withBloc(bloc).expectStates(const [
33-
Initial(),
3433
Loading(),
3534
Empty(),
3635
]),
@@ -54,23 +53,22 @@ void main() {
5453
});
5554

5655
test(
57-
'should emit list loaded with elements matching the filter when loading first page',
56+
'should emit [$Loading, $Success] with elements matching the filter when loading first page',
5857
() {
5958
when(() {
6059
loadingFirstPage(filter: filter);
6160
});
6261

6362
then(() {
6463
withBloc(bloc).expectStates([
65-
const Initial(),
6664
const Loading(),
6765
Success(PagedList(firstPage, hasReachedMax: false)),
6866
]);
6967
});
7068
});
7169

7270
test(
73-
'should emit list loaded with first, first and second page elements matching filter when loading two pages',
71+
'should emit [$Loading, $Success, $Success] with first, first and second page elements matching filter when loading two pages',
7472
() {
7573
when(() {
7674
loadingFirstPage(filter: filter);
@@ -79,7 +77,6 @@ void main() {
7977

8078
then(() {
8179
withBloc(bloc).expectStates([
82-
const Initial(),
8380
const Loading(),
8481
Success(PagedList(firstPage, hasReachedMax: false)),
8582
Success(PagedList(firstPage + secondPage, hasReachedMax: true)),
@@ -101,12 +98,11 @@ void main() {
10198
bloc = PagedListFilterBloc<int, int>(repository);
10299
});
103100

104-
test('should emit list not loaded when error occurs', () {
101+
test('should emit [$Loading, $Failure] when error occurs', () {
105102
when(loadingFirstPage);
106103

107104
then(
108105
() => withBloc(bloc).expectStates([
109-
const Initial(),
110106
const Loading(),
111107
Failure(error),
112108
]),
@@ -126,11 +122,10 @@ void main() {
126122
bloc = PagedListFilterBloc<int, int>(repository);
127123
});
128124

129-
test('should emit list loaded empty when first page was not found', () {
125+
test('should emit [$Loading, $Empty] when first page was not found', () {
130126
when(loadingFirstPage);
131127
then(
132128
() => withBloc(bloc).expectStates(const [
133-
Initial(),
134129
Loading(),
135130
Empty(),
136131
]),

0 commit comments

Comments
 (0)