forked from eatvio/eatvio_app
feat(tests): updated tests coverage to 66.5%
This commit is contained in:
34
test/features/order_info/cubit/order_info_state_test.dart
Normal file
34
test/features/order_info/cubit/order_info_state_test.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:eatvio_app/features/order_info/cubit/order_info_state.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('OrderInfoState', () {
|
||||
test('creates instance with default values', () {
|
||||
final state = OrderInfoState();
|
||||
|
||||
expect(state.isLoading, isTrue);
|
||||
expect(state.chosenPlan, isNull);
|
||||
expect(state.customerProfile, isNull);
|
||||
});
|
||||
|
||||
test('creates instance with custom values', () {
|
||||
final state = OrderInfoState(
|
||||
isLoading: false,
|
||||
);
|
||||
|
||||
expect(state.isLoading, isFalse);
|
||||
expect(state.chosenPlan, isNull);
|
||||
expect(state.customerProfile, isNull);
|
||||
});
|
||||
|
||||
test('copyWith creates new instance with updated values', () {
|
||||
final original = OrderInfoState();
|
||||
final updated = original.copyWith(isLoading: false);
|
||||
|
||||
expect(updated.isLoading, isFalse);
|
||||
expect(updated.chosenPlan, original.chosenPlan);
|
||||
expect(updated.customerProfile, original.customerProfile);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user