Skip to content

Commit de06c4a

Browse files
committed
Add basic test coverage for known single word attributes
1 parent 0ccbe71 commit de06c4a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,18 @@ describe('ReactDOMComponent', () => {
20802080
'Warning: Invalid prop `whatever` on <div> tag.',
20812081
);
20822082
});
2083+
2084+
it('warns on bad casing of known HTML attributes', function() {
2085+
spyOn(console, 'error');
2086+
2087+
var el = ReactTestUtils.renderIntoDocument(<div SiZe="30" />);
2088+
2089+
expect(el.getAttribute('size')).toBe('30');
2090+
2091+
expectDev(console.error.calls.argsFor(0)[0]).toContain(
2092+
'Warning: Invalid DOM property `SiZe`. Did you mean `size`?',
2093+
);
2094+
});
20832095
});
20842096

20852097
describe('Object stringification', function() {

0 commit comments

Comments
 (0)