From 0dac41b1149fa1176f8daa7a6541738eca74d42b Mon Sep 17 00:00:00 2001 From: GouravShDev <74348508+GouravShDev@users.noreply.github.com> Date: Thu, 9 Mar 2023 12:03:12 +0530 Subject: [PATCH] chore: add node tests (#1943) --- .../test/core/document/node_test.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/appflowy_flutter/packages/appflowy_editor/test/core/document/node_test.dart b/frontend/appflowy_flutter/packages/appflowy_editor/test/core/document/node_test.dart index 4e407fd321..853df05671 100644 --- a/frontend/appflowy_flutter/packages/appflowy_editor/test/core/document/node_test.dart +++ b/frontend/appflowy_flutter/packages/appflowy_editor/test/core/document/node_test.dart @@ -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'); + }); }); }