twonly-app-dependencies/flutter_markdown_plus/test/header_test.dart
2026-04-22 17:15:35 +02:00

35 lines
972 B
Dart

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
import 'package:flutter_test/flutter_test.dart';
import 'utils.dart';
void main() => defineTests();
void defineTests() {
group('Header', () {
testWidgets(
'level one',
(WidgetTester tester) async {
const String data = '# Header';
await tester.pumpWidget(boilerplate(const MarkdownBody(data: data)));
final Iterable<Widget> widgets = selfAndDescendantWidgetsOf(
find.byType(MarkdownBody),
tester,
);
expectWidgetTypes(widgets, <Type>[
MarkdownBody,
Column,
Wrap,
Text,
RichText,
]);
expectTextStrings(widgets, <String>['Header']);
},
);
});
}