-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
6,084 additions
and
1,867 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest/globals": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:jest/recommended" | ||
], | ||
"globals": { | ||
"Atomics": "readable", | ||
"SharedArrayBuffer": "readable" | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["react", "jest"], | ||
"rules": { | ||
"jest/no-disabled-tests": "warn", | ||
"jest/no-focused-tests": "error", | ||
"jest/no-identical-title": "error", | ||
"jest/prefer-to-have-length": "warn", | ||
"jest/valid-expect": "error" | ||
}, | ||
"parser": "babel-eslint" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/* eslint-disable */ | ||
|
||
var nodemailer = require("nodemailer"); | ||
|
||
require("dotenv").config(); | ||
|
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,9 +1,9 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
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,49 @@ | ||
import { configure, mount, shallow } from "enzyme"; | ||
import Adapter from "enzyme-adapter-react-16"; | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
import { initializeFirebase } from "../firebase"; | ||
|
||
import Alert from "./Alert"; | ||
|
||
configure({ adapter: new Adapter() }); | ||
|
||
describe("src/Components/Alert", () => { | ||
it("should render", () => { | ||
initializeFirebase(); | ||
const component = renderer.create( | ||
<Alert | ||
data={{ | ||
asset: "BTC", | ||
amount: "600", | ||
action: "above", | ||
currency: "USD", | ||
email: "[email protected]" | ||
}} | ||
/> | ||
); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it("should display 'Loading' when no data props", () => { | ||
const alert = shallow(<Alert />); | ||
expect(alert.text()).toEqual("Loading..."); | ||
}); | ||
|
||
it("should display an alert when receiving data props", () => { | ||
const alert = mount( | ||
<Alert | ||
data={{ | ||
asset: "BTC", | ||
amount: "600", | ||
action: "above", | ||
currency: "USD", | ||
email: "[email protected]" | ||
}} | ||
/> | ||
); | ||
expect(alert.text()).toContain("When BTC is above 600USD"); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { configure, mount } from "enzyme"; | ||
import Adapter from "enzyme-adapter-react-16"; | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
import { initializeFirebase } from "../firebase"; | ||
|
||
import Form from "./Form"; | ||
|
||
configure({ adapter: new Adapter() }); | ||
|
||
describe("src/Components/Form", () => { | ||
it("should render", () => { | ||
initializeFirebase(); | ||
const component = renderer.create( | ||
<Form | ||
initialValues={{ | ||
data: { | ||
asset: "BTC", | ||
amount: "600", | ||
action: "above", | ||
currency: "USD", | ||
email: "[email protected]" | ||
} | ||
}} | ||
/> | ||
); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
it("should render the Edition From when there are initial values", () => { | ||
const form = mount( | ||
<Form | ||
initialValues={{ | ||
data: { | ||
asset: "BTC", | ||
amount: "600", | ||
action: "above", | ||
currency: "USD", | ||
email: "[email protected]" | ||
} | ||
}} | ||
/> | ||
); | ||
expect(form.find(".FormEdit")).toHaveLength(1); | ||
expect(form.find(".FormCreate")).toHaveLength(0); | ||
}); | ||
|
||
it("should render the Creation From when there are no initial values", () => { | ||
const form = mount(<Form />); | ||
expect(form.find(".FormCreate")).toHaveLength(1); | ||
expect(form.find(".FormEdit")).toHaveLength(0); | ||
}); | ||
}); |
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,19 @@ | ||
import { configure } from "enzyme"; | ||
import Adapter from "enzyme-adapter-react-16"; | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
import { initializeFirebase } from "../firebase"; | ||
|
||
import List from "./List"; | ||
|
||
configure({ adapter: new Adapter() }); | ||
|
||
describe("src/Components/List", () => { | ||
it("should render", () => { | ||
initializeFirebase(); | ||
const component = renderer.create(<List />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
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,47 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`src/Components/Alert should render 1`] = ` | ||
<div | ||
className="Alert" | ||
> | ||
<div | ||
className="AlertText" | ||
> | ||
<div | ||
className="buttons" | ||
> | ||
<button | ||
onClick={[Function]} | ||
> | ||
<span | ||
aria-label="edit" | ||
role="img" | ||
> | ||
🖊️ | ||
</span> | ||
</button> | ||
<button | ||
onClick={[Function]} | ||
> | ||
<span | ||
aria-label="close" | ||
role="img" | ||
> | ||
❌ | ||
</span> | ||
</button> | ||
</div> | ||
<div> | ||
When | ||
BTC | ||
is | ||
above | ||
600 | ||
USD | ||
to: | ||
[email protected] | ||
</div> | ||
</div> | ||
</div> | ||
`; |
Oops, something went wrong.