This file contains hidden or 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
import React, { Component } from "react"; | |
import { Input, Button, Typography, Row, Col, message } from "antd"; | |
import TableResult from "./components/TableResult"; | |
import { validationAmount } from "../../utils/helpers"; | |
import { fractions } from "../../config/fractions"; | |
class Home extends Component { | |
state = { | |
amount: "", | |
amountLeft: null, |
This file contains hidden or 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
import React from "react"; | |
import { Layout, Icon } from "antd"; | |
import Home from "./Home"; | |
import "./App.css"; | |
const App = () => { | |
return ( | |
<Layout className="app"> | |
<Layout.Content> | |
<div className="box"> |
This file contains hidden or 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
// Check if there are ',' & '.' in a input and after ',' is not 00 | |
function checkSeparator(amount) { | |
if (amount.indexOf(",") > -1 || amount.indexOf(" ") > -1) { | |
if (amount.split(",")[1] !== "00") { | |
throw new Error("Invalid separator!"); | |
} | |
} | |
} | |
// Check Rp is wrong position |
This file contains hidden or 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
/* global describe, it, expect, beforeEach :true */ | |
import React from "react"; | |
import { shallow, configure } from "enzyme"; | |
import Adapter from "enzyme-adapter-react-16"; | |
import Home from "../scenes/Home"; | |
configure({ adapter: new Adapter() }); | |
describe("Home Scene", () => { | |
const wrapper = shallow(<Home />); |
OlderNewer