forked from eatvio/eatvio_app
fix: issue-942, issue-967, fixed images positioning for blog posts
This commit is contained in:
@@ -24,6 +24,7 @@ void main() {
|
||||
String? slug,
|
||||
int? id,
|
||||
bool? disableActions,
|
||||
bool isAuthorAdmin = false,
|
||||
}) {
|
||||
return MaterialApp(
|
||||
theme: ThemeHelper().themeData(),
|
||||
@@ -42,6 +43,7 @@ void main() {
|
||||
slug: slug,
|
||||
id: id,
|
||||
disableActions: disableActions,
|
||||
isAuthorAdmin: isAuthorAdmin,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -71,7 +73,23 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(MoreOptions), findsOneWidget);
|
||||
expect(find.text('Пожаловаться'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('hides complain option when author is admin', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
createTestWidget(
|
||||
complainedContentType: ComplainedContent.diet,
|
||||
id: 1,
|
||||
slug: 'test-slug',
|
||||
isAuthorAdmin: true,
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Пожаловаться'), findsNothing);
|
||||
expect(find.text('Скопировать ссылку'), findsOneWidget);
|
||||
expect(find.text('Поделиться'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('disables actions when disableActions is true', (tester) async {
|
||||
|
||||
Reference in New Issue
Block a user