-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove react test renderer from I18n Specs #1532
Conversation
Fixes #1445 |
src/components/i18n/__spec__.js
Outdated
const output = shallowRenderer.getRenderOutput(); | ||
expect(output.type).toEqual('span'); | ||
expect(output.props.children).toEqual('bar'); | ||
describe('when component is rendered with only a key', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be scope
? Can't see anything called key
src/components/i18n/__spec__.js
Outdated
expect(output.type).toEqual('div'); | ||
expect(output.props.children).toEqual('bar'); | ||
describe('when component is rendered with inline set to false', () => { | ||
it('renders the value of the key in a div', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope?
This seems to be adding
Perhaps moment needs updating and react-addons? |
__html: 'something <strong>bold</strong>' | ||
describe('when component is rendered inline', () => { | ||
it('renders the parsed markdown in a span', () => { | ||
spyOn(i18n, 't').and.returnValue('something __bold__'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer jest.fn()
__html: '<p>something <strong>bold</strong></p>\n' | ||
describe('when component is rendered as a block', () => { | ||
it('renders the parsed markdown in a div', () => { | ||
spyOn(i18n, 't').and.returnValue('something __bold__'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer jest.fn()
__html: 'some <span>html</span>' | ||
describe('when component is rendered with html in the value', () => { | ||
it('parses the html correctly', () => { | ||
spyOn(i18n, 't').and.returnValue('some <span>html</span>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer jest.fn()
"fbjs": "0.8.15", | ||
"object-assign": "4.1.1" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be re-added?
Description
React test renderer was just used for shallow rendering of I18n specs. These specs have been refactored to use enzyme/snapshot testing
Snapshot tests need to be triple checked before merging.
NOTE: Module has been re-added as it is required by enzyme - enzymejs/enzyme#875