tabs => tab_label

This commit is contained in:
Ankit Mahato
2025-04-05 20:50:22 +05:30
parent 7e8123e947
commit c394e298b2
3 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
import 'package:apidash/widgets/tab_label.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('TabLabel shows indicator when showIndicator is true',
(tester) async {
const String labelText = 'URL Params';
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: TabLabel(
text: labelText,
showIndicator: true,
),
),
),
);
expect(find.text(labelText), findsOneWidget);
expect(find.byIcon(Icons.circle), findsOneWidget);
});
testWidgets('TabLabel does not show indicator when showIndicator is false',
(tester) async {
const String labelText = 'Request';
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: TabLabel(
text: labelText,
showIndicator: false,
),
),
),
);
expect(find.text(labelText), findsOneWidget);
expect(find.byIcon(Icons.circle), findsNothing);
});
}