Skip to content

Commit

Permalink
Add more specific warning assertion for React DOM factories
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Jan 23, 2017
1 parent da03cba commit 1612436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/addons/__tests__/ReactDOMFactories-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ReactDOMFactories', () => {
spyOn(console, 'error');
var element = div();
expect(element.type).toBe('div');
expectDev(console.error.calls.count()).toBe(0);
expectDev(console.error).not.toHaveBeenCalled();
});

it('warns once when accessing React.DOM methods', () => {
Expand All @@ -31,6 +31,9 @@ describe('ReactDOMFactories', () => {
expect(a.type).toBe('a');
expect(p.type).toBe('p');

expectDev(console.error.calls.count()).toBe(1);
expectDev(console.error).toHaveBeenCalledTimes(1);
expectDev(console.error.calls.first().args[0]).toContain(
'Warning: Accessing factories like React.DOM.a has been deprecated'
);
});
});

0 comments on commit 1612436

Please sign in to comment.