Skip to content

Commit

Permalink
Add basic test coverage for known single word attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Aug 18, 2017
1 parent 0ccbe71 commit de06c4a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,18 @@ describe('ReactDOMComponent', () => {
'Warning: Invalid prop `whatever` on <div> tag.',
);
});

it('warns on bad casing of known HTML attributes', function() {
spyOn(console, 'error');

var el = ReactTestUtils.renderIntoDocument(<div SiZe="30" />);

expect(el.getAttribute('size')).toBe('30');

expectDev(console.error.calls.argsFor(0)[0]).toContain(
'Warning: Invalid DOM property `SiZe`. Did you mean `size`?',
);
});
});

describe('Object stringification', function() {
Expand Down

0 comments on commit de06c4a

Please sign in to comment.