Skip to content

Commit 0dac41b

Browse files
authored
chore: add node tests (#1943)
1 parent b89c69f commit 0dac41b

File tree

1 file changed

+18
-0
lines changed
  • frontend/appflowy_flutter/packages/appflowy_editor/test/core/document

1 file changed

+18
-0
lines changed

frontend/appflowy_flutter/packages/appflowy_editor/test/core/document/node_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,23 @@ void main() async {
228228
final textNode = TextNode.empty()..delta = (Delta()..insert('AppFlowy'));
229229
expect(textNode.toPlainText(), 'AppFlowy');
230230
});
231+
test('test node id', () {
232+
final nodeA = Node(
233+
type: 'example',
234+
children: LinkedList(),
235+
attributes: {},
236+
);
237+
final nodeAId = nodeA.id;
238+
expect(nodeAId, 'example');
239+
final nodeB = Node(
240+
type: 'example',
241+
children: LinkedList(),
242+
attributes: {
243+
'subtype': 'exampleSubtype',
244+
},
245+
);
246+
final nodeBId = nodeB.id;
247+
expect(nodeBId, 'example/exampleSubtype');
248+
});
231249
});
232250
}

0 commit comments

Comments
 (0)