fix: handle null context in MarkdownHtmlWidget and improve test stability with pumpAndSettle calls

This commit is contained in:
mso7nueh
2026-01-13 13:03:58 +03:00
parent 7b425e56f1
commit c786821275
9 changed files with 22 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ void main() {
const MarketingBottomSheet(),
),
);
await tester.pumpAndSettle();
expect(find.byType(MarketingBottomSheet), findsOneWidget);
});
@@ -59,6 +60,7 @@ void main() {
),
);
await tester.pump();
await tester.tap(find.text('Show'));
await tester.pumpAndSettle();

View File

@@ -24,6 +24,7 @@ void main() {
testWidgets('returns SizedBox.shrink when option is null', (tester) async {
await tester.pumpWidget(createTestWidget(const OptionWidget(option: null, duration: 7)));
await tester.pumpAndSettle();
expect(find.byType(OptionWidget), findsOneWidget);
expect(find.byType(SizedBox), findsWidgets);
@@ -33,6 +34,7 @@ void main() {
const option = PacketOptions(items: ['Item 1', 'Item 2'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: false);
await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7)));
await tester.pumpAndSettle();
expect(find.byType(OptionWidget), findsOneWidget);
expect(find.text('Short'), findsOneWidget);
@@ -43,6 +45,7 @@ void main() {
const option = PacketOptions(items: ['Item 1'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: true);
await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7)));
await tester.pumpAndSettle();
expect(find.byType(OptionWidget), findsOneWidget);
});
@@ -51,6 +54,7 @@ void main() {
const option = PacketOptions(items: ['Item 1'], price: 1000.0, short: 'Short', description: 'Description', hasPersonalDiet: false);
await tester.pumpWidget(createTestWidget(const OptionWidget(option: option, duration: 7, disableDuration: true)));
await tester.pumpAndSettle();
expect(find.byType(OptionWidget), findsOneWidget);
});

View File

@@ -31,6 +31,7 @@ void main() {
),
);
await tester.pump();
await tester.tap(find.text('Show Error'));
await tester.pumpAndSettle();
@@ -68,6 +69,7 @@ void main() {
),
);
await tester.pump();
await tester.tap(find.text('Show Error'));
await tester.pumpAndSettle();
@@ -103,6 +105,7 @@ void main() {
),
);
await tester.pump();
await tester.tap(find.text('Show Error'));
await tester.pumpAndSettle();
@@ -134,6 +137,7 @@ void main() {
),
);
await tester.pump();
await tester.tap(find.text('Show Error'));
await tester.pumpAndSettle();