Skip to content

Commit

Permalink
TF-3002 Write test to ensure search filter send to interactor is exac…
Browse files Browse the repository at this point in the history
…tly which user changed
  • Loading branch information
dab246 committed Oct 3, 2024
1 parent 9431502 commit d4114f4
Showing 1 changed file with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,45 @@ void main() {
filterOption: FilterMessageOption.all,
mailboxId: testMailboxId),
propertiesCreated: ThreadConstants.propertiesDefault,
propertiesUpdated: ThreadConstants.propertiesUpdatedDefault));
propertiesUpdated: ThreadConstants.propertiesUpdatedDefault
)).called(1);
});

test(
'WHEN user search email by keyword\n'
'THEN user select chip filter\n'
'SHOULD search filter matched with user changed',
() async {
// arrange
when(context.owner).thenReturn(BuildOwner(focusManager: FocusManager()));

// act
mailboxDashboardController.searchEmail(queryString: queryString);
mailboxDashboardController.selectSortOrderQuickSearchFilter(context, EmailSortOrderType.oldest);
mailboxDashboardController.selectHasAttachmentSearchFilter();
mailboxDashboardController.selectReceiveTimeQuickSearchFilter(context, EmailReceiveTimeType.last30Days);

await untilCalled(searchEmailInteractor.execute(
any,
any,
limit: anyNamed('limit'),
position: anyNamed('position'),
sort: anyNamed('sort'),
filter: anyNamed('filter'),
properties: anyNamed('properties')));

// assert
expect(
searchController.searchEmailFilter.value,
SearchEmailFilter(
text: SearchQuery(queryString),
emailReceiveTimeType: EmailReceiveTimeType.last30Days,
hasAttachment: true,
sortOrder: EmailSortOrderType.oldest.getSortOrder().toNullable()
)
);
});

tearDown(Get.deleteAll);
});

Expand Down

0 comments on commit d4114f4

Please sign in to comment.