forked from eatvio/eatvio_app
fix: fixed analyzer and test
This commit is contained in:
@@ -200,13 +200,13 @@ void main() {
|
||||
.thenAnswer((_) async => chosenPlan);
|
||||
await cubit.getChosenPlan(id: 1);
|
||||
|
||||
when(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'mock'))
|
||||
when(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'alfa-bank'))
|
||||
.thenAnswer((_) async => paymentModel);
|
||||
|
||||
final result = await cubit.getPaymentLink();
|
||||
|
||||
expect(result, equals('https://payment.url'));
|
||||
verify(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'mock')).called(1);
|
||||
verify(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'alfa-bank')).called(1);
|
||||
});
|
||||
|
||||
test('getPaymentLink - возвращает null, если план не выбран', () async {
|
||||
@@ -254,7 +254,7 @@ void main() {
|
||||
.thenAnswer((_) async => chosenPlan);
|
||||
await cubit.getChosenPlan(id: 1);
|
||||
|
||||
when(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'mock'))
|
||||
when(mockChatRepository.getPaymentLink(id: 1, paymentProvider: 'alfa-bank'))
|
||||
.thenThrow(Exception('Ошибка'));
|
||||
|
||||
final result = await cubit.getPaymentLink();
|
||||
|
||||
@@ -76,7 +76,7 @@ void main() {
|
||||
|
||||
testWidgets('Да → форма → Пропустить → вызывает SbpBanks', (tester) async {
|
||||
gateResult = true;
|
||||
formResult = PromoCodeResult();
|
||||
formResult = const PromoCodeResult();
|
||||
await tester.pumpWidget(createTestApp());
|
||||
|
||||
await showConsultationPaymentFlow(
|
||||
|
||||
@@ -60,7 +60,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
onValidate: (code) async {
|
||||
captured ??= PromoValidation.failure('Промокод не найден или истёк');
|
||||
captured ??= const PromoValidation.failure('Промокод не найден или истёк');
|
||||
return captured!;
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user