|
|
@@ -13,7 +13,7 @@ void main() {
|
|
13
|
13
|
group('$ZefyrButton', () {
|
|
14
|
14
|
testWidgets('toggle style', (tester) async {
|
|
15
|
15
|
final editor = new EditorSandBox(tester: tester);
|
|
16
|
|
- await editor.tapEditor();
|
|
|
16
|
+ await editor.pumpAndTap();
|
|
17
|
17
|
await editor.updateSelection(base: 5, extent: 10);
|
|
18
|
18
|
await editor.tapButtonWithIcon(Icons.format_bold);
|
|
19
|
19
|
|
|
|
@@ -31,7 +31,7 @@ void main() {
|
|
31
|
31
|
testWidgets('toggle state for different styles of the same attribute',
|
|
32
|
32
|
(tester) async {
|
|
33
|
33
|
final editor = new EditorSandBox(tester: tester);
|
|
34
|
|
- await editor.tapEditor();
|
|
|
34
|
+ await editor.pumpAndTap();
|
|
35
|
35
|
|
|
36
|
36
|
await editor.tapButtonWithIcon(Icons.format_list_bulleted);
|
|
37
|
37
|
expect(editor.document.root.children.first, isInstanceOf<BlockNode>());
|
|
|
@@ -46,7 +46,7 @@ void main() {
|
|
46
|
46
|
group('$HeadingButton', () {
|
|
47
|
47
|
testWidgets('toggle menu', (tester) async {
|
|
48
|
48
|
final editor = new EditorSandBox(tester: tester);
|
|
49
|
|
- await editor.tapEditor();
|
|
|
49
|
+ await editor.pumpAndTap();
|
|
50
|
50
|
await editor.tapButtonWithIcon(Icons.format_size);
|
|
51
|
51
|
|
|
52
|
52
|
expect(find.text('H1'), findsOneWidget);
|
|
|
@@ -60,7 +60,7 @@ void main() {
|
|
60
|
60
|
|
|
61
|
61
|
testWidgets('toggle styles', (tester) async {
|
|
62
|
62
|
final editor = new EditorSandBox(tester: tester);
|
|
63
|
|
- await editor.tapEditor();
|
|
|
63
|
+ await editor.pumpAndTap();
|
|
64
|
64
|
await editor.tapButtonWithIcon(Icons.format_size);
|
|
65
|
65
|
await editor.tapButtonWithText('H3');
|
|
66
|
66
|
LineNode line = editor.document.root.children.first;
|
|
|
@@ -71,7 +71,7 @@ void main() {
|
|
71
|
71
|
|
|
72
|
72
|
testWidgets('close overlay', (tester) async {
|
|
73
|
73
|
final editor = new EditorSandBox(tester: tester);
|
|
74
|
|
- await editor.tapEditor();
|
|
|
74
|
+ await editor.pumpAndTap();
|
|
75
|
75
|
await editor.tapButtonWithIcon(Icons.format_size);
|
|
76
|
76
|
expect(find.text('H1'), findsOneWidget);
|
|
77
|
77
|
await editor.tapButtonWithIcon(Icons.close);
|
|
|
@@ -82,7 +82,7 @@ void main() {
|
|
82
|
82
|
group('$LinkButton', () {
|
|
83
|
83
|
testWidgets('disabled when selection is collapsed', (tester) async {
|
|
84
|
84
|
final editor = new EditorSandBox(tester: tester);
|
|
85
|
|
- await editor.tapEditor();
|
|
|
85
|
+ await editor.pumpAndTap();
|
|
86
|
86
|
await editor.tapButtonWithIcon(Icons.link);
|
|
87
|
87
|
expect(find.byIcon(Icons.link_off), findsNothing);
|
|
88
|
88
|
});
|
|
|
@@ -90,7 +90,7 @@ void main() {
|
|
90
|
90
|
testWidgets('enabled and toggles menu with non-empty selection',
|
|
91
|
91
|
(tester) async {
|
|
92
|
92
|
final editor = new EditorSandBox(tester: tester);
|
|
93
|
|
- await editor.tapEditor();
|
|
|
93
|
+ await editor.pumpAndTap();
|
|
94
|
94
|
await editor.updateSelection(base: 5, extent: 10);
|
|
95
|
95
|
await editor.tapButtonWithIcon(Icons.link);
|
|
96
|
96
|
expect(find.byIcon(Icons.link_off), findsOneWidget);
|
|
|
@@ -98,7 +98,7 @@ void main() {
|
|
98
|
98
|
|
|
99
|
99
|
testWidgets('auto cancels edit on selection update', (tester) async {
|
|
100
|
100
|
final editor = new EditorSandBox(tester: tester);
|
|
101
|
|
- await editor.tapEditor();
|
|
|
101
|
+ await editor.pumpAndTap();
|
|
102
|
102
|
await editor.updateSelection(base: 5, extent: 10);
|
|
103
|
103
|
await editor.tapButtonWithIcon(Icons.link);
|
|
104
|
104
|
await tester
|
|
|
@@ -111,7 +111,7 @@ void main() {
|
|
111
|
111
|
|
|
112
|
112
|
testWidgets('editing link', (tester) async {
|
|
113
|
113
|
final editor = new EditorSandBox(tester: tester);
|
|
114
|
|
- await editor.tapEditor();
|
|
|
114
|
+ await editor.pumpAndTap();
|
|
115
|
115
|
await editor.updateSelection(base: 5, extent: 10);
|
|
116
|
116
|
|
|
117
|
117
|
await editor.tapButtonWithIcon(Icons.link);
|
|
|
@@ -160,7 +160,7 @@ void main() {
|
|
160
|
160
|
|
|
161
|
161
|
testWidgets('toggle overlay', (tester) async {
|
|
162
|
162
|
final editor = new EditorSandBox(tester: tester);
|
|
163
|
|
- await editor.tapEditor();
|
|
|
163
|
+ await editor.pumpAndTap();
|
|
164
|
164
|
await editor.tapButtonWithIcon(Icons.photo);
|
|
165
|
165
|
|
|
166
|
166
|
expect(find.byIcon(Icons.photo_camera), findsOneWidget);
|
|
|
@@ -170,7 +170,7 @@ void main() {
|
|
170
|
170
|
|
|
171
|
171
|
testWidgets('pick from camera', (tester) async {
|
|
172
|
172
|
final editor = new EditorSandBox(tester: tester);
|
|
173
|
|
- await editor.tapEditor();
|
|
|
173
|
+ await editor.pumpAndTap();
|
|
174
|
174
|
await editor.tapButtonWithIcon(Icons.photo);
|
|
175
|
175
|
await editor.tapButtonWithIcon(Icons.photo_camera);
|
|
176
|
176
|
expect(log, hasLength(1));
|
|
|
@@ -189,7 +189,7 @@ void main() {
|
|
189
|
189
|
|
|
190
|
190
|
testWidgets('pick from gallery', (tester) async {
|
|
191
|
191
|
final editor = new EditorSandBox(tester: tester);
|
|
192
|
|
- await editor.tapEditor();
|
|
|
192
|
+ await editor.pumpAndTap();
|
|
193
|
193
|
await editor.tapButtonWithIcon(Icons.photo);
|
|
194
|
194
|
await editor.tapButtonWithIcon(Icons.photo_library);
|
|
195
|
195
|
expect(log, hasLength(1));
|