Skip to content

Commit

Permalink
Merge 260c646 into d800f01
Browse files Browse the repository at this point in the history
  • Loading branch information
JackNeto committed Dec 24, 2018
2 parents d800f01 + 260c646 commit 1610231
Show file tree
Hide file tree
Showing 59 changed files with 1,828 additions and 1,466 deletions.
130 changes: 102 additions & 28 deletions src/common/AutoComplete/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,37 +1,111 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DateTimeSelect matches snapshot 1`] = `
exports[`AutoComplete matches snapshot 1`] = `
<div
className="MuiFormControl-root-2"
onClick={[Function]}
onKeyPress={[Function]}
className="css-10nd86i"
onKeyDown={[Function]}
>
<label
className="MuiFormLabel-root-13 MuiFormLabel-filled-17 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10 MuiInputLabel-shrink-9"
data-shrink={true}
>
Date
</label>
<div
className="MuiInputBase-root-33 MuiInput-root-20 MuiInput-underline-24 MuiInputBase-formControl-34 MuiInput-formControl-21"
onClick={[Function]}
className="css-vj8t7z"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
<input
aria-invalid={false}
className="MuiInputBase-input-43 MuiInput-input-28"
disabled={false}
mask={null}
name="createdAt"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
pipe={null}
readOnly={true}
required={false}
type="text"
value="January 1st 12:00 a.m."
/>
<div
className="css-1hwfws3"
>
<div
className="css-1492t68"
>
Institution
</div>
<div
className="css-1g6gooi"
>
<div
className=""
style={
Object {
"display": "inline-block",
}
}
>
<input
aria-autocomplete="list"
autoCapitalize="none"
autoComplete="off"
autoCorrect="off"
disabled={false}
id="react-select-2-input"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
spellCheck="false"
style={
Object {
"background": 0,
"border": 0,
"boxSizing": "content-box",
"color": "inherit",
"fontSize": "inherit",
"opacity": 1,
"outline": 0,
"padding": 0,
"width": "1px",
}
}
tabIndex="0"
type="text"
value=""
/>
<div
style={
Object {
"height": 0,
"left": 0,
"overflow": "scroll",
"position": "absolute",
"top": 0,
"visibility": "hidden",
"whiteSpace": "pre",
}
}
>
</div>
</div>
</div>
</div>
<div
className="css-1wy0on6"
>
<span
className="css-d8oujb"
/>
<div
aria-hidden="true"
className="css-1ep9fjw"
onMouseDown={[Function]}
onTouchEnd={[Function]}
>
<svg
aria-hidden="true"
className="css-19bqh2r"
focusable="false"
height={20}
viewBox="0 0 20 20"
width={20}
>
<path
d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
/>
</svg>
</div>
</div>
</div>
<input
name="institution"
type="hidden"
value=""
/>
</div>
`;
12 changes: 6 additions & 6 deletions src/common/AutoComplete/__tests__/index.test.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import renderer from 'react-test-renderer'
import DateTimeSelect from '../'
import AutoComplete from '../'

describe('DateTimeSelect', () => {
describe('AutoComplete', () => {
const mochOnChange = jest.fn()

beforeEach(() => {
Expand All @@ -11,10 +11,10 @@ describe('DateTimeSelect', () => {

it('matches snapshot', () => {
const component = renderer.create((
<DateTimeSelect
label="Date"
name="createdAt"
value={new Date('1/1/2018')}
<AutoComplete
label="Institution"
name="institution"
options={[{ label: 'TD', value: 'TD' }]}
onChange={mochOnChange}
/>
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ exports[`DateTimeSelect matches snapshot 1`] = `
onKeyPress={[Function]}
>
<label
className="MuiFormLabel-root-13 MuiFormLabel-filled-17 MuiInputLabel-root-6 MuiInputLabel-formControl-7 MuiInputLabel-animated-10 MuiInputLabel-shrink-9"
className="MuiFormLabel-root-17 MuiFormLabel-filled-21 MuiInputLabel-root-6 MuiInputLabel-formControl-11 MuiInputLabel-animated-14 MuiInputLabel-shrink-13"
data-shrink={true}
>
Date
</label>
<div
className="MuiInputBase-root-33 MuiInput-root-20 MuiInput-underline-24 MuiInputBase-formControl-34 MuiInput-formControl-21"
className="MuiInputBase-root-37 MuiInput-root-24 MuiInput-underline-28 MuiInputBase-formControl-38 MuiInput-formControl-25"
onClick={[Function]}
>
<input
aria-invalid={false}
className="MuiInputBase-input-43 MuiInput-input-28"
className="MuiInputBase-input-47 MuiInput-input-32"
disabled={false}
mask={null}
name="createdAt"
Expand Down
3 changes: 3 additions & 0 deletions src/common/HandleLogin/__tests__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jest.mock('blockstack', () => {

describe('HandleLogin', () => {
const mochHandlePendingSignIn = jest.fn()
const mochHistoryPush = jest.fn()
mochHandlePendingSignIn.mockReturnValue(Promise.resolve())

it('matches snapshot with logged out user', () => {
const component = renderer.create((
<HandleLoginComponent
handlePendingSignIn={mochHandlePendingSignIn}
history={{}}
/>
))
expect(mochHandlePendingSignIn).not.toHaveBeenCalled()
Expand All @@ -29,6 +31,7 @@ describe('HandleLogin', () => {
<HandleLoginComponent
user={{ isLoginPending: true }}
handlePendingSignIn={mochHandlePendingSignIn}
history={{ push: mochHistoryPush }}
/>
))
expect(mochHandlePendingSignIn).toHaveBeenCalled()
Expand Down
1 change: 1 addition & 0 deletions src/common/HandleLogin/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { isSignInPending } from 'blockstack'
Expand Down
Loading

0 comments on commit 1610231

Please sign in to comment.