fix: document getting first or last node exception (#885)

This commit is contained in:
LinJi 2024-09-11 17:51:35 +08:00 • committed by GitHub
commit c3c700524c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -220,4 +220,14 @@ void main() async {
final last = document.last!;
expect(last.delta!.toPlainText(), secondChild);
});
test('Document.blank().first is null', () {
final document = Document.blank();
expect(document.first, isNull);
});
test('Document.blank().last is null', () {
final document = Document.blank();
expect(document.last, isNull);
});
}