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

Refactor login page to get rid of warning on test #6083

Merged
merged 1 commit into from Jun 28, 2018

Conversation

kaankabalak
Copy link
Contributor

Description

This commit refactors the Login.js file such that, instead of checking the DOM directly, the Access Key and Secret Key values are now stored in the state.

Motivation and Context

This commit refactors the Login.js file to get rid of the following warning that appears while unit testing:

PASS  app/js/browser/__tests__/Login.test.js
  ● Console
    console.error node_modules/fbjs/lib/warning.js:33
      Warning: render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.
    console.error node_modules/fbjs/lib/warning.js:33
      Warning: render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.

How Has This Been Tested?

  • Manually:

    • Logging in with both credentials empty (Returns warning pointing to the Access Key field saying "Please fill out this field)
    • Logging in with just the Access Key empty (Returns warning pointing to the Access Key field saying "Please fill out this field)
    • Logging in with just the Secret Key empty (Returns warning pointing to the Secret Key field saying "Please fill out this field)
    • Logging in with an Access Key less than 3 characters (Returns alert saying "access key must be minimum 3 or more characters long")
    • Logging in with a Secret Key less than 8 characters (Returns alert saying "secret key must be minimum 8 or more characters long")
    • Logging in with incorrect Access Key (Returns alert saying "The access key ID you provided does not exist in our records")
    • Logging in with correct Access Key but incorrect Secret Key (Returns alert saying "Authentication failed, check your access credentials")
    • Logging in with correct credentials (Logs in successfully)
  • By running unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.
  • I have added/updated functional tests in mint. (If yes, add mint PR # here: )
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Jun 26, 2018

Codecov Report

Merging #6083 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6083      +/-   ##
==========================================
- Coverage   58.72%   58.71%   -0.02%     
==========================================
  Files         218      218              
  Lines       31656    31656              
==========================================
- Hits        18591    18587       -4     
- Misses      11419    11423       +4     
  Partials     1646     1646
Impacted Files Coverage Δ
cmd/retry.go 82.14% <0%> (-5.36%) ⬇️
cmd/fs-v1-multipart.go 65.25% <0%> (-0.2%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad79c62...a884100. Read the comment docs.


secretKeyChange(e) {
this.setState({
secretKey: e.target.value
Copy link
Member

Choose a reason for hiding this comment

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

Is this a good idea, how secure is State() does it use browser localStorage?? Am I assuming it's not transmitted on CORS requests?

@kannappanr kannappanr merged commit 8bd7a19 into minio:master Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants