Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

SeanArmstrong
Copy link

@SeanArmstrong SeanArmstrong commented Sep 6, 2017

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

@andrewjtait
Copy link
Contributor

Fixes #1445

const output = shallowRenderer.getRenderOutput();
expect(output.type).toEqual('span');
expect(output.props.children).toEqual('bar');
describe('when component is rendered with only a key', () => {
Copy link
Contributor

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

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope?

@SeanArmstrong
Copy link
Author

SeanArmstrong commented Sep 25, 2017

This seems to be adding

    console.warn node_modules/react-addons-test-utils/index.js:33
      Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning.
    console.error node_modules/fbjs/lib/warning.js:35
      Warning: Shallow renderer has been moved to react-test-renderer/shallow. Update references to remove this warning.
    console.warn node_modules/moment/moment.js:282

Perhaps moment needs updating and react-addons?

@SeanArmstrong SeanArmstrong changed the title Remove react test renderer Remove react test renderer from I18n Specs Sep 25, 2017
__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__');
Copy link
Contributor

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__');
Copy link
Contributor

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 &lt;span&gt;html&lt;/span&gt;'
describe('when component is rendered with html in the value', () => {
it('parses the html correctly', () => {
spyOn(i18n, 't').and.returnValue('some <span>html</span>');
Copy link
Contributor

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"
}
},
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants