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

Framework: Remove i18n mixin injections from tests #18471

Merged
merged 4 commits into from
Oct 3, 2017

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Oct 3, 2017

Remove i18n mixin injections from tests (and some obsolete matches-selector stubs I found while working on this). This PR really only touches test files -- the corresponding units have been using localize already, only the tests hadn't been updated accordingly yet.

Rationale: We're trying to get rid of mixin auto-injection for the React 16 upgrade, since this relies on methods (react/lib) that aren't part of the public interface.

To test: Verify that unit tests pass.

Follow-up PR that tackles client/auth/test/login.jsx which also requires changes to the tested unit.

@matticbot
Copy link
Contributor

@ockham ockham self-assigned this Oct 3, 2017
@ockham ockham requested review from sirreal, samouri and tyxla October 3, 2017 10:01
@ockham ockham force-pushed the remove/i18n-mixin-injections branch 3 times, most recently from cccd62e to 82d4b3f Compare October 3, 2017 10:14
@ockham ockham force-pushed the remove/i18n-mixin-injections branch from 82d4b3f to 2957c58 Compare October 3, 2017 10:25
@ockham ockham force-pushed the remove/i18n-mixin-injections branch from 721b008 to 85b8e57 Compare October 3, 2017 10:37
@ockham ockham added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Oct 3, 2017
@ockham ockham requested a review from jsnajdr October 3, 2017 17:11
import assert from 'assert';
import sinon from 'sinon';
import { identity } from 'lodash';

/**
* External dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

Lies!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot. 2c2f670

@samouri
Copy link
Contributor

samouri commented Oct 3, 2017

I don't really know the old paradigm of mixin injection for tests. You are deleting setup code and tests still pass...so seems good to me!

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Awesome cleanup, 🚢 it!

@tyxla tyxla added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Oct 3, 2017
@ockham
Copy link
Contributor Author

ockham commented Oct 3, 2017

I don't really know the old paradigm of mixin injection for tests. You are deleting setup code and tests still pass...so seems good to me!

@samauri I think the reason is simply that

the corresponding units have been using localize already, only the tests hadn't been updated accordingly yet.

@ockham ockham merged commit ee95c16 into master Oct 3, 2017
@ockham ockham deleted the remove/i18n-mixin-injections branch October 3, 2017 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants