mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 14:47:13 -04:00
chore: add node tests (#1943)
This commit is contained in:
parent
b89c69f294
commit
0dac41b114
1 changed files with 18 additions and 0 deletions
|
@ -228,5 +228,23 @@ void main() async {
|
||||||
final textNode = TextNode.empty()..delta = (Delta()..insert('AppFlowy'));
|
final textNode = TextNode.empty()..delta = (Delta()..insert('AppFlowy'));
|
||||||
expect(textNode.toPlainText(), '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…
Add table
Add a link
Reference in a new issue