Files
feeddeck/app/test/widgets/item/preview/utils/item_title_test.dart
Rico Berger 8c88ece3dc [lemmy] Add Support for Lemmy (#94)
This commit adds support to add Lemmy RSS feeds to FeedDeck. A user can
provide the url of an Lemmy instance, the url of a community or of an
user.

The special thing of the Lemmy source in opposite to the normal RSS
source is, that we parse the provided link form a feed item, to check if
it contains a image, video or YouTube url, to apply some special
formatting.
2023-12-02 15:52:50 +01:00

30 lines
820 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:feeddeck/widgets/item/preview/utils/item_title.dart';
void main() {
testWidgets('Should render title', (tester) async {
await tester.pumpWidget(
const MaterialApp(
home: ItemTitle(itemTitle: 'My Title'),
),
);
expect(find.byType(Container), findsOneWidget);
expect(find.byType(Text), findsOneWidget);
expect(find.text('My Title'), findsOneWidget);
});
testWidgets('Should render empty container when empty string is provided',
(tester) async {
await tester.pumpWidget(
const MaterialApp(
home: ItemTitle(itemTitle: ''),
),
);
expect(find.byType(Container), findsOneWidget);
expect(find.byType(Text), findsNothing);
});
}