fix: fixed analyzer and test

This commit is contained in:
misha
2026-07-14 16:11:56 +03:00
parent b064c7016e
commit de19af14bf
3 changed files with 5 additions and 5 deletions

View File

@@ -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();

View File

@@ -76,7 +76,7 @@ void main() {
testWidgets('Да → форма → Пропустить → вызывает SbpBanks', (tester) async {
gateResult = true;
formResult = PromoCodeResult();
formResult = const PromoCodeResult();
await tester.pumpWidget(createTestApp());
await showConsultationPaymentFlow(

View File

@@ -60,7 +60,7 @@ void main() {
await tester.pumpWidget(
createTestWidget(
onValidate: (code) async {
captured ??= PromoValidation.failure('Промокод не найден или истёк');
captured ??= const PromoValidation.failure('Промокод не найден или истёк');
return captured!;
},
),