Skip to content

Instantly share code, notes, and snippets.

@danahartweg
Created July 27, 2020 03:54
Show Gist options
  • Save danahartweg/f66ec83d00ef0db4e2f4c9591d816dcb to your computer and use it in GitHub Desktop.
Save danahartweg/f66ec83d00ef0db4e2f4c9591d816dcb to your computer and use it in GitHub Desktop.
Item list test - Support boolean properties to flutter_bloc_list_manager
blocTest(
'returns source items matching a single active boolean condition key',
build: () async {
whenListen(
_filterConditionsBloc,
Stream.value(
ConditionsInitialized(
activeConditions: <String>{
generateConditionKey('conditional', 'True'),
},
availableConditions: {},
),
),
);
whenListen(_searchQueryBloc, Stream.value(''));
whenListen(
_sourceBloc,
Stream.value(
MockSourceBlocClassItems([_mockItem1, _mockItem2, _mockItem3]),
),
);
return ItemListBloc<MockItemClass, MockSourceBlocClassItems>(
filterConditionsBloc: _filterConditionsBloc,
searchQueryBloc: _searchQueryBloc,
sourceBloc: _sourceBloc,
);
},
expect: [
ItemResults([_mockItem1, _mockItem3])
],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment