refactor: clean up imports and improve code readability across various files

This commit is contained in:
mso7nueh
2025-12-24 17:54:35 +03:00
parent 3d774267ca
commit e158d812e4
41 changed files with 4699 additions and 4613 deletions

View File

@@ -1,77 +1,79 @@
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: const 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: const 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: const Scaffold(
body: CommentContainer(comment: longComment),
),
),
);
expect(find.byType(CommentContainer), findsOneWidget);
expect(find.text(longComment), findsOneWidget);
});
});
}
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: const 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: const 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: const Scaffold(
body: CommentContainer(comment: longComment),
),
),
);
expect(find.byType(CommentContainer), findsOneWidget);
expect(find.text(longComment), findsOneWidget);
});
});
}