Skip to content

Commit 598fbf1

Browse files
committed
test: ✅ add test of alias has of attributes in XmlNode
1 parent 54c9471 commit 598fbf1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/xml_nodes/xml_node.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,19 @@ describe('xml node', () => {
164164
i += 1;
165165
}
166166
});
167+
168+
test('alias for has of attributes', () => {
169+
const node = new XmlNode('x');
170+
node.setAttribute('id', 'form');
171+
node.setAttribute('key', 'custom');
172+
173+
expect(node.hasAttribute('id')).toBeTruthy();
174+
expect(node.hasAttribute('key')).toBeTruthy();
175+
176+
node.setAttribute('id', null);
177+
expect(node.hasAttribute('id')).toBeFalsy();
178+
179+
node.setAttribute('key', undefined);
180+
expect(node.hasAttribute('key')).toBeFalsy();
181+
});
167182
});

0 commit comments

Comments
 (0)