test: improve test coverage (#23)

This commit is contained in:
Mathias Mogensen 2023-03-24 13:59:03 +01:00 • committed by GitHub
commit 226d39cc78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,17 @@ void main() async {
assert(transaction.operations[2] is UpdateOperation);
assert(isInsertAndPathEqual(transaction.operations[3], [0], '0'));
});
test("HistoryItem sealed", () {
final historyItem = HistoryItem();
historyItem.add(
DeleteOperation([0], [TextNode(delta: Delta()..insert('0'))]),
);
historyItem.seal();
expect(historyItem.sealed, true);
});
}
bool isInsertAndPathEqual(Operation operation, Path path, [String? content]) {