MotorSignal-App/patrol_test/social_feed_patrol_test.dart

51 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'package:motorcycle_dash/main.dart' as app;
void main() {
patrolTest(
'verify social community feed multi-stream and navigation on emulator',
($) async {
await app.main();
await $.pumpAndSettle();
// 1. Navigate to Social section via bottom nav bar
final socialNav = find.byKey(const ValueKey('nav_social_icon'));
expect(socialNav, findsOneWidget);
await $(socialNav).tap();
await $.pumpAndSettle();
// 2. Switch from Hub to Feed tab
final feedToggle = find.byKey(const ValueKey('social_tab_feed'));
expect(feedToggle, findsOneWidget);
await $(feedToggle).tap();
await $.pumpAndSettle();
// 3. Verify multi-stream tabs are present
expect(find.text('All Activity'), findsWidgets);
expect(find.text('Club Only'), findsWidgets);
expect(find.text('Nearby Packs'), findsWidgets);
expect(find.text('For You'), findsWidgets);
expect(find.text('Following'), findsWidgets);
// 4. Verify Riding Discipline filter chips are present
expect(find.text('All Styles'), findsWidgets);
expect(find.text('⚡ Canyon'), findsWidgets);
// 5. Select Canyon discipline filter
await $(find.text('⚡ Canyon')).tap();
await $.pumpAndSettle();
// 6. Verify active filter summary bar displays
expect(find.textContaining('Filtered by:'), findsOneWidget);
expect(find.text('Reset'), findsOneWidget);
// 7. Reset filters
await $(find.text('Reset')).tap();
await $.pumpAndSettle();
expect(find.textContaining('Filtered by:'), findsNothing);
},
);
}