chore: add node tests (#1943)

This commit is contained in:
GouravShDev 2023-03-09 12:03:12 +05:30 committed by GitHub
parent b89c69f294
commit 0dac41b114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,5 +228,23 @@ void main() async {
final textNode = TextNode.empty()..delta = (Delta()..insert('AppFlowy'));
expect(textNode.toPlainText(), 'AppFlowy');
});
test('test node id', () {
final nodeA = Node(
type: 'example',
children: LinkedList(),
attributes: {},
);
final nodeAId = nodeA.id;
expect(nodeAId, 'example');
final nodeB = Node(
type: 'example',
children: LinkedList(),
attributes: {
'subtype': 'exampleSubtype',
},
);
final nodeBId = nodeB.id;
expect(nodeBId, 'example/exampleSubtype');
});
});
}