forked from eatvio/eatvio_app
chore(version): update app version to 1.3.5+85 and improve test coverage reporting in CI
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/widgets/comment_container.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('CommentContainer', () {
|
||||
testWidgets('displays comment text', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeHelper().themeData(),
|
||||
home: Scaffold(
|
||||
body: CommentContainer(comment: 'Test comment'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byType(CommentContainer), findsOneWidget);
|
||||
expect(find.text('Test comment'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('displays empty comment', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeHelper().themeData(),
|
||||
home: Scaffold(
|
||||
body: CommentContainer(comment: ''),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byType(CommentContainer), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('displays long comment', (tester) async {
|
||||
const longComment = 'This is a very long comment that should be displayed properly in the container';
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeHelper().themeData(),
|
||||
home: Scaffold(
|
||||
body: CommentContainer(comment: longComment),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byType(CommentContainer), findsOneWidget);
|
||||
expect(find.text(longComment), findsOneWidget);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user