test: add unit tests for poultry repository and searchable dropdown functionalities
- Introduced tests for `PoultryScienceRepositoryImp` to validate delegated remote calls. - Added comprehensive tests for `SearchableDropdownLogic` covering selection, overlay, and search logic. - Enhanced `SearchableDropdown` widget tests for multi-select, label building, and overlay management.
This commit is contained in:
@@ -146,45 +146,6 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('submitUserInfo', () {
|
||||
test(
|
||||
'should call remote submitUserInfo with correct parameters',
|
||||
() async {
|
||||
// Arrange
|
||||
const phone = '09123456789';
|
||||
const deviceName = 'Test Device';
|
||||
final expectedData = {'mobile': phone, 'device_name': deviceName};
|
||||
|
||||
when(
|
||||
() => mockAuthRemote.submitUserInfo(any()),
|
||||
).thenAnswer((_) async {});
|
||||
|
||||
// Act
|
||||
await authRepository.submitUserInfo(
|
||||
phone: phone,
|
||||
deviceName: deviceName,
|
||||
);
|
||||
|
||||
// Assert
|
||||
verify(() => mockAuthRemote.submitUserInfo(expectedData)).called(1);
|
||||
},
|
||||
);
|
||||
|
||||
test('should call remote submitUserInfo without device name', () async {
|
||||
// Arrange
|
||||
const phone = '09123456789';
|
||||
final expectedData = {'mobile': phone, 'device_name': null};
|
||||
|
||||
when(
|
||||
() => mockAuthRemote.submitUserInfo(any()),
|
||||
).thenAnswer((_) async {});
|
||||
|
||||
// Act
|
||||
await authRepository.submitUserInfo(phone: phone);
|
||||
|
||||
// Assert
|
||||
verify(() => mockAuthRemote.submitUserInfo(expectedData)).called(1);
|
||||
});
|
||||
});
|
||||
// submitUserInfo removed from API; covered by stewardAppLogin at remote layer
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user