Skip to content

Commit

Permalink
Merge branch 'fix-1706-remove-attribute-with-non-string' of github.co…
Browse files Browse the repository at this point in the history
…m:OlaviSau/happy-dom into fix-1706-remove-attribute-with-non-string
  • Loading branch information
OlaviSau committed Jan 30, 2025
2 parents 8492df9 + c5bd563 commit 7936d65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/happy-dom/test/nodes/element/Element.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,14 @@ describe('Element', () => {
});
});

describe('should ignore removeAttribute() when passed a non string attribute', () => {
it('Should stringify the attribute and remove it', () => {
element.setAttribute('undefined', 'value1');
element.removeAttribute(undefined);
expect(element.attributes.length).toBe(0);
});
});

describe('removeAttributeNS()', () => {
it('Removes a namespace attribute.', () => {
element.setAttributeNS(NAMESPACE_URI, 'global:local', 'value');
Expand Down

0 comments on commit 7936d65

Please sign in to comment.