We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54c9471 commit 598fbf1Copy full SHA for 598fbf1
tests/unit/xml_nodes/xml_node.spec.ts
@@ -164,4 +164,19 @@ describe('xml node', () => {
164
i += 1;
165
}
166
});
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
+ });
182
0 commit comments