Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Aug 31, 2023
1 parent e9d6fea commit b22171f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/browser/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@ describe('render()', () => {
expect(scratch.firstChild).to.have.property('nodeName', 'X-BAR');
});

it('should not register non-function event handlers', () => {
const proto = Element.prototype;
proto.addEventListener.resetHistory();
render(
<x-bar
only-overflow={true}
onChange={() => {
console.log('Change');
}}
/>,
scratch
);

expect(proto.addEventListener).to.have.been.calledOnce;
expect(scratch.childNodes).to.have.length(1);
expect(scratch.firstChild).to.have.property('nodeName', 'X-BAR');
});

it('should support the form attribute', () => {
render(
<div>
Expand Down

0 comments on commit b22171f

Please sign in to comment.