-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[component] Add login component and write tests #18
Closes #18
- Loading branch information
1 parent
b1349da
commit b2460df
Showing
26 changed files
with
1,359 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
{ | ||
"extends": [ | ||
"airbnb", | ||
"prettier", | ||
"prettier/react", | ||
"jest-enzyme", | ||
"plugin:jest/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"plugins": ["prettier", "jest"], | ||
"parserOptions": { | ||
"ecmaVersion": 2016, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": [2, "never"], | ||
"semi": [2, "always"], | ||
"react/prefer-stateless-function": [0], | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
"extensions": [".js", ".jsx"] | ||
} | ||
] | ||
} | ||
"extends": [ | ||
"airbnb", | ||
"prettier", | ||
"prettier/react", | ||
"jest-enzyme", | ||
"plugin:jest/recommended" | ||
], | ||
"parser": "babel-eslint", | ||
"plugins": ["prettier", "jest"], | ||
"parserOptions": { | ||
"ecmaVersion": 2016, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"array-bracket-spacing": [2, "never"], | ||
"semi": [2, "always"], | ||
"jsx-a11y/label-has-for": 0, | ||
"react/prefer-stateless-function": [0], | ||
"react/jsx-filename-extension": [ | ||
1, | ||
{ | ||
"extensions": [".js", ".jsx"] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
client/components/login/__snapshots__/login.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Login /> rendering should render correctly 1`] = ` | ||
<div | ||
className="owisp-login-container" | ||
> | ||
<form | ||
className="owisp-login-form" | ||
onSubmit={[Function]} | ||
> | ||
<div | ||
className="owisp-login-header" | ||
> | ||
<div | ||
className="owisp-login-header-content" | ||
> | ||
sign in | ||
</div> | ||
</div> | ||
<div | ||
className="owisp-login-fieldset" | ||
> | ||
<label | ||
className="owisp-login-label owisp-login-label-username" | ||
htmlFor="owisp-login-username" | ||
> | ||
<div | ||
className="owisp-login-label-text" | ||
> | ||
username | ||
</div> | ||
<input | ||
className="owisp-login-input | ||
owisp-login-input-username | ||
" | ||
id="owisp-login-username" | ||
name="username" | ||
onChange={[Function]} | ||
pattern="[a-zA-Z@.+\\\\-_\\\\d]{1,150}" | ||
placeholder="enter username" | ||
required={true} | ||
title="only letters, numbers, and @/./+/-/_ characters" | ||
type="text" | ||
value="" | ||
/> | ||
</label> | ||
<label | ||
className="owisp-login-label owisp-login-label-password" | ||
htmlFor="owisp-login-password" | ||
> | ||
<div | ||
className="owisp-login-label-text" | ||
> | ||
password | ||
</div> | ||
<input | ||
className="owisp-login-input owisp-login-input-password | ||
" | ||
id="owisp-login-password" | ||
name="password" | ||
onChange={[Function]} | ||
pattern=".{6,}" | ||
placeholder="password" | ||
required={true} | ||
title="password must be a minimum of 6 characters" | ||
type="password" | ||
value="" | ||
/> | ||
</label> | ||
</div> | ||
<div | ||
className="owisp-login-add-info" | ||
> | ||
By logging in, you accept the | ||
<a | ||
className="owisp-login-additional-link" | ||
href="/default/login/terms-and-conditions" | ||
onClick={[Function]} | ||
> | ||
terms and conditions | ||
</a> | ||
and the | ||
<a | ||
className="owisp-login-additional-link" | ||
href="/default/login/privacy-policy" | ||
onClick={[Function]} | ||
> | ||
privacy policy | ||
</a> | ||
of this WiFi service. | ||
</div> | ||
<input | ||
className="owisp-login-form-btn owisp-login-login-btn" | ||
id="owisp-login-login-btn" | ||
type="submit" | ||
value="sign in" | ||
/> | ||
<hr | ||
className="owisp-login-social-hr" | ||
data-content="OR" | ||
/> | ||
<div | ||
className="owisp-login-divider-description" | ||
> | ||
login with | ||
</div> | ||
<div | ||
className="owisp-login-social-links-div" | ||
/> | ||
<div | ||
className="owisp-login-links-div" | ||
> | ||
<a | ||
className="owisp-login-link" | ||
href="/default/password/reset" | ||
onClick={[Function]} | ||
> | ||
Forgot your password? | ||
</a> | ||
<a | ||
className="owisp-login-link" | ||
href="/default/registration" | ||
onClick={[Function]} | ||
> | ||
Not registered yet? Create an account | ||
</a> | ||
</div> | ||
</form> | ||
</div> | ||
`; |
Oops, something went wrong.