dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
813 B
32 lines
813 B
2 years ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_quill/src/widgets/controller.dart';
|
||
|
import 'package:flutter_quill/src/widgets/editor.dart';
|
||
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
|
||
|
import '../widget_tester_extension.dart';
|
||
|
|
||
|
void main() {
|
||
|
late QuillController controller;
|
||
|
|
||
|
setUp(() {
|
||
|
controller = QuillController.basic();
|
||
|
});
|
||
|
|
||
|
tearDown(() {
|
||
|
controller.dispose();
|
||
|
});
|
||
|
|
||
|
group('QuillEditor', () {
|
||
|
testWidgets('Keyboard entered text is stored in document', (tester) async {
|
||
|
await tester.pumpWidget(
|
||
|
MaterialApp(
|
||
|
home: QuillEditor.basic(controller: controller, readOnly: false),
|
||
|
),
|
||
|
);
|
||
|
await tester.quillEnterText(find.byType(QuillEditor), 'test\n');
|
||
|
|
||
|
expect(controller.document.toPlainText(), 'test\n');
|
||
|
});
|
||
|
});
|
||
|
}
|