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

LPS-97292 Add numeric tests #1063

Closed
wants to merge 473 commits into from

Conversation

alinedoleron
Copy link

No description provided.

dantewang and others added 30 commits July 8, 2019 20:43
Main mechanism is updating to liferay-npm-scripts v4.6.0, which includes
a "liferay/metal" preset for dealing with portions of the codebase that
use metal-jsx rather than React. This allows us to remove suppressions
for 34 problems.

Other suppressions were already addressed in prior commits (eg.
84ea82e), but we forgot to remove the suppression comments.
@brunobasto
Copy link
Owner

Just started reviewing :)

:octocat: Sent from GH.

Copy link
Owner

@brunobasto brunobasto left a comment

Choose a reason for hiding this comment

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

Very good. Thank you. Just a few notes.

const numberMaskOptions = this.getMaskConfig(dataType);

if (value && dataType == 'integer') {
inputElement.value = Math.round(value.replace(',', '.'));
Copy link
Owner

Choose a reason for hiding this comment

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

@alinedoleron is there a reason for using hardcoded comma instead of the symbol variable?

this.emit('fieldEdited', {
fieldInstance: this,
originalEvent: event,
if (value.substr(-1) != this.symbols.decimalSymbol) {
Copy link
Owner

Choose a reason for hiding this comment

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

@alinedoleron We can now do early return instead of wrapping the entire method inside an if statement

@@ -122,7 +131,6 @@ class Numeric extends Component {

_internalValueFn() {
const {value} = this;

Copy link
Owner

Choose a reason for hiding this comment

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

@alinedoleron Not sure we have a rule for that, but I prefer a line between variable declarations and the return statement.

expect.objectContaining({
fieldInstance: component,
originalEvent: expect.any(Object),
value: expect.any(String)
Copy link
Owner

Choose a reason for hiding this comment

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

@alinedoleron I think it would be better to explicitly say the value we expect here.

@alinedoleron
Copy link
Author

ci:test:sf

@alinedoleron
Copy link
Author

Thanks, @brunobasto. I've made the changes.

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutes 33 seconds 4 ms

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: d299adac7f78108245a69357064bd6f3cfee0c38

Sender Branch:

Branch Name: LPS-97313_v2
Branch GIT ID: b6533267b6bb092d9fd10e6e975c97281a20a061

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@brunobasto
Copy link
Owner

Just started reviewing :)

:octocat: Sent from GH.

@brunobasto
Copy link
Owner

Pull request submitted to https://github.com/jeyvison/liferay-portal/pull/518. See changes here.

:octocat: Sent from GH.

@brunobasto brunobasto closed this Jul 10, 2019
@brunobasto
Copy link
Owner

Pull request submitted to https://github.com/jeyvison/liferay-portal/pull/519. See changes here.

:octocat: Sent from GH.

@alinedoleron alinedoleron deleted the LPS-97313_v2 branch March 2, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet