Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
DAreRodz committed Sep 20, 2023
1 parent 7dc66bc commit b163b7d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/browser/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,4 +1281,20 @@ describe('render()', () => {
render(<div tabindex={null} />, scratch);
expect(scratch.firstChild.tabIndex).to.equal(defaultValue);
});

it('should unset role if null || undefined', () => {
render(
<section>
<div role="status">role="status"</div>
<div role={undefined}>role="undefined"</div>
<div role={null}>role="null"</div>
</section>,
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);
});
});

0 comments on commit b163b7d

Please sign in to comment.