|
@@ -170,5 +170,19 @@ void main() {
|
170
|
170
|
var result = controller.getSelectionStyle();
|
171
|
171
|
expect(result.values, [NotusAttribute.bold]);
|
172
|
172
|
});
|
|
173
|
+ test('formatText with toggled style for first charater', () {
|
|
174
|
+ bool notified = false;
|
|
175
|
+ controller.addListener(() {
|
|
176
|
+ notified = true;
|
|
177
|
+ });
|
|
178
|
+ controller.formatText(0, 0, NotusAttribute.bold);
|
|
179
|
+ controller.replaceText(0, 0, 'Word');
|
|
180
|
+ expect(notified, isTrue);
|
|
181
|
+ expect(
|
|
182
|
+ controller.document.toDelta(),
|
|
183
|
+ Delta()..insert('Word', NotusAttribute.bold.toJson())..insert('\n'),
|
|
184
|
+ );
|
|
185
|
+ expect(controller.lastChangeSource, ChangeSource.local);
|
|
186
|
+ });
|
173
|
187
|
});
|
174
|
188
|
}
|