zefyr

editable_paragraph_test.dart 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (c) 2018, the Zefyr project authors. Please see the AUTHORS file
  2. // for details. All rights reserved. Use of this source code is governed by a
  3. // BSD-style license that can be found in the LICENSE file.
  4. import 'dart:ui';
  5. import 'package:flutter/material.dart';
  6. import 'package:flutter_test/flutter_test.dart';
  7. import 'package:zefyr/src/widgets/editable_rich_text.dart';
  8. import 'package:zefyr/zefyr.dart';
  9. void main() {
  10. group('$EditableRichText', () {
  11. final doc = new NotusDocument();
  12. doc.insert(0, 'This House Is A Circus');
  13. final text = new TextSpan(text: 'This House Is A Circus');
  14. Widget widget;
  15. setUp(() {
  16. widget = new Directionality(
  17. textDirection: TextDirection.ltr,
  18. child: new EditableRichText(
  19. node: doc.root.children.first,
  20. text: text,
  21. ),
  22. );
  23. });
  24. testWidgets('initialize', (tester) async {
  25. await tester.pumpWidget(widget);
  26. EditableRichText result =
  27. tester.firstWidget(find.byType(EditableRichText));
  28. expect(result, isNotNull);
  29. expect(result.text.text, 'This House Is A Circus');
  30. });
  31. });
  32. }