mirror of
https://github.com/foss42/apidash.git
synced 2025-06-01 06:42:07 +08:00
Update test case 1
This commit is contained in:
@ -5,20 +5,30 @@ import 'package:apidash/widgets/markdown.dart';
|
||||
|
||||
void main() {
|
||||
group('CustomMarkdown Widget Tests', () {
|
||||
testWidgets('Testing CustomMarkdown buttons and tags renders', (tester) async {
|
||||
testWidgets('Testing CustomMarkdown buttons and tags renders',
|
||||
(tester) async {
|
||||
const markdown = CustomMarkdown(
|
||||
data: """Is a markdown ~`star on github`~
|
||||
|
||||
#br
|
||||
#br
|
||||
#br
|
||||
#br
|
||||
|
||||
~`github repo`~ ~`Discord Server`~""",
|
||||
~`github repo`~ ~`Discord Server`~""",
|
||||
);
|
||||
await tester.pumpWidget(const MaterialApp(home: markdown));
|
||||
|
||||
expect(find.byType(InlineButton), findsNWidgets(3));
|
||||
expect(find.byIcon(Icons.star), findsOneWidget);
|
||||
expect(find.text("star on github"), findsOneWidget);
|
||||
|
||||
expect(find.byIcon(Icons.discord), findsOneWidget);
|
||||
expect(find.text("Discord Server"), findsOneWidget);
|
||||
|
||||
expect(find.byIcon(Icons.code_rounded), findsOneWidget);
|
||||
expect(find.text("github repo"), findsOneWidget);
|
||||
|
||||
expect(find.text('#br'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('CustomMarkdown renders correctly',
|
||||
(WidgetTester tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(
|
||||
|
Reference in New Issue
Block a user