From b163b7d94db0b1685d3341ae0651977949ff555f Mon Sep 17 00:00:00 2001 From: David Arenas Date: Wed, 20 Sep 2023 11:28:09 +0200 Subject: [PATCH] add failing test --- test/browser/render.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/browser/render.test.js b/test/browser/render.test.js index 241e7f7d5f..fdb80eeb81 100644 --- a/test/browser/render.test.js +++ b/test/browser/render.test.js @@ -1281,4 +1281,20 @@ describe('render()', () => { render(
, scratch); expect(scratch.firstChild.tabIndex).to.equal(defaultValue); }); + + it('should unset role if null || undefined', () => { + render( +
+
role="status"
+
role="undefined"
+
role="null"
+
, + scratch + ); + + const divs = scratch.querySelectorAll('div'); + expect(divs[0].hasAttribute('role')).to.equal(true); + expect(divs[1].hasAttribute('role')).to.equal(false); + expect(divs[2].hasAttribute('role')).to.equal(false); + }); });