Source kinds, Learn tab and catalog update #9
No files matched your search
@@ -9,7 +9,7 @@ import 'storage.dart';
|
||||
/// Recognizes paid and sponsored articles so the feed can hide them.
|
||||
///
|
||||
/// Most paid articles are marked in the title (heise+, Golem's "(g+)").
|
||||
/// Substack newsletters cut paid posts short in the feed and end them with a
|
||||
/// Substack cuts paid posts short in the feed and ends them with a
|
||||
/// "Read more" link to the post itself, so those are recognized from the feed.
|
||||
/// SPIEGEL and t3n only mark them in the page's schema.org data
|
||||
/// (`"isAccessibleForFree": false`), so for those sources each new article is
|
||||
|
||||
@@ -73,7 +73,7 @@ void main() {
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('leaving the Sources tab after a change refreshes the feeds', (tester) async {
|
||||
testWidgets('leaving the Sources tab after a change refreshes all Sources', (tester) async {
|
||||
final feedService = FakeFeeds(feeds);
|
||||
final state = await launch(tester, feedService);
|
||||
await tester.pumpWidget(MaterialApp(home: HomeShell(state: state)));
|
||||
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
substackNews.feedUrl: 'test/fixtures/ahead_of_ai_feed.xml',
|
||||
});
|
||||
|
||||
test('paid newsletter posts are hidden in the Learn tab and Today and counted as hidden',
|
||||
test('paid Substack posts are hidden in the Learn tab and Today and counted as hidden',
|
||||
() async {
|
||||
final state = await launchApp([interconnects, substackNews], feedService: savedFeeds());
|
||||
|
||||
@@ -61,7 +61,7 @@ void main() {
|
||||
expect(state.hiddenCountOf(SourceKind.news), 1);
|
||||
});
|
||||
|
||||
test('with "hide paid articles" off, paid newsletter posts show as before', () async {
|
||||
test('with "hide paid articles" off, paid Substack posts show as before', () async {
|
||||
final state = await launchApp([interconnects, substackNews], feedService: savedFeeds());
|
||||
|
||||
await state.updateSettings(state.settings.copyWith(hidePaid: false));
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
expect(find.text(german), findsNothing);
|
||||
});
|
||||
|
||||
Future<void> addFeed(WidgetTester tester, String name, {String? kind}) async {
|
||||
Future<void> addSource(WidgetTester tester, String name, {String? kind}) async {
|
||||
await tester.tap(find.text('Add feed'));
|
||||
await tester.pumpAndSettle();
|
||||
final dialog = find.byType(AlertDialog);
|
||||
@@ -97,29 +97,29 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
testWidgets('a feed added without picking a kind is a News source', (tester) async {
|
||||
testWidgets('a Source added without picking a kind is a News source', (tester) async {
|
||||
final state = await launch(tester, [verge, bytebytego]);
|
||||
await showSources(tester, state);
|
||||
|
||||
await addFeed(tester, 'myfeed');
|
||||
await addSource(tester, 'myfeed');
|
||||
|
||||
expectInOrder(tester, [find.text('News'), find.text('myfeed'), find.text('Learning')]);
|
||||
});
|
||||
|
||||
testWidgets('a feed added as Learning shows up in the Learning section', (tester) async {
|
||||
testWidgets('a Source added as Learning shows up in the Learning section', (tester) async {
|
||||
final state = await launch(tester, [verge, bytebytego]);
|
||||
await showSources(tester, state);
|
||||
|
||||
await addFeed(tester, 'myblog', kind: 'Learning');
|
||||
await addSource(tester, 'myblog', kind: 'Learning');
|
||||
|
||||
expectInOrder(tester, [find.text('Learning'), find.text('myblog')]);
|
||||
});
|
||||
|
||||
testWidgets('a feed added as Fun gets a Fun section', (tester) async {
|
||||
testWidgets('a Source added as Fun gets a Fun section', (tester) async {
|
||||
final state = await launch(tester, [verge]);
|
||||
await showSources(tester, state);
|
||||
|
||||
await addFeed(tester, 'mycomic', kind: 'Fun');
|
||||
await addSource(tester, 'mycomic', kind: 'Fun');
|
||||
|
||||
expectInOrder(tester, [find.text('News'), find.text('Fun'), find.text('mycomic')]);
|
||||
});
|
||||
@@ -140,7 +140,7 @@ void main() {
|
||||
|
||||
await tester.tap(tab('Sources'));
|
||||
await tester.pump();
|
||||
await addFeed(tester, 'myblog', kind: 'Learning');
|
||||
await addSource(tester, 'myblog', kind: 'Learning');
|
||||
await tester.tap(tab('Learn'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -170,7 +170,7 @@ void main() {
|
||||
|
||||
await tester.tap(tab('Sources'));
|
||||
await tester.pump();
|
||||
await addFeed(tester, 'mycomic', kind: 'Fun');
|
||||
await addSource(tester, 'mycomic', kind: 'Fun');
|
||||
await tester.tap(tab('Learn'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class FakeFeeds extends FeedService {
|
||||
/// Feed URL -> (title, age) of each article in the feed.
|
||||
final Map<String, List<(String, Duration)>> byFeedUrl;
|
||||
|
||||
/// How often the app refreshed its feeds.
|
||||
/// How often the app refreshed all Sources.
|
||||
int refreshes = 0;
|
||||
|
||||
@override
|
||||
|
||||
Reference in new issue
Block a user