mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: add node tests (#1943)
This commit is contained in:
parent
b89c69f294
commit
0dac41b114
@ -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');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user