New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

augur-ui-react-components

Package Overview
Dependencies
Maintainers
4
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

augur-ui-react-components - npm Package Compare versions

Comparing version 3.0.31 to 3.0.32

src/modules/market/components/order-book-parameters.jsx

2

package.json
{
"name": "augur-ui-react-components",
"version": "3.0.31",
"version": "3.0.32",
"description": "Augur UI React Components",

@@ -5,0 +5,0 @@ "author": "Baz (@thinkloop)",

import React from 'react';
import { render } from 'react-dom';
import { ACCOUNT, MAKE, TRANSACTIONS, M, MY_POSITIONS, MY_MARKETS, MY_REPORTS } from './modules/site/constants/pages';
import { ACCOUNT, MAKE, POSITIONS, TRANSACTIONS, M } from './modules/site/constants/pages';
import { REGISTER, LOGIN, LOGOUT } from './modules/auth/constants/auth-types';

@@ -12,3 +12,3 @@

import AccountPage from './modules/account/components/account-page';
import PortfolioPage from './modules/portfolio/components/portfolio-page';
import PositionsPage from './modules/positions/components/positions-page';
import TransactionsPage from './modules/transactions/components/transactions-page';

@@ -28,8 +28,7 @@

marketsLink: p.links && p.links.marketsLink || undefined,
positionsLink: p.links && p.links.positionsLink || undefined,
transactionsLink: p.links && p.links.transactionsLink || undefined,
authLink: p.links && p.links.authLink || undefined,
accountLink: p.links && p.links.accountLink || undefined,
accountLinkText: p.loginAccount && p.loginAccount.linkText || undefined,
myPositionsLink: p.links && p.links.myPositionsLink || undefined,
portfolioTotals: p.portfolio && p.portfolio.totals || undefined
accountLinkText: p.loginAccount && p.loginAccount.linkText || undefined
};

@@ -68,2 +67,12 @@

case POSITIONS:
node = (
<PositionsPage
siteHeader={p.siteHeader}
positionsSummary={p.positionsSummary}
positionsMarkets={p.positionsMarkets}
/>
);
break;
case TRANSACTIONS:

@@ -91,13 +100,2 @@ node = (

case MY_POSITIONS:
case MY_MARKETS:
case MY_REPORTS:
node = (
<PortfolioPage
siteHeader={p.siteHeader}
{...p.portfolio}
/>
);
break;
default:

@@ -104,0 +102,0 @@ node = (

@@ -25,8 +25,2 @@ import activePage from '../test/assertions/active-page';

import orderCancellation from '../test/assertions/order-cancellation';
import portfolio from '../test/assertions/portfolio';
import portfolioNavItems from '../test/assertions/portfolio-nav-items';
import loginAccountPositions from '../test/assertions/login-account-positions';
import loginAccountMarkets from '../test/assertions/login-account-markets';
import loginAccountReports from '../test/assertions/login-account-reports';
import portfolioTotals from '../test/assertions/portfolio-totals';

@@ -57,9 +51,3 @@ export default {

selectedUserOpenOrdersGroup,
orderCancellation,
portfolio,
portfolioNavItems,
portfolioTotals,
loginAccountPositions,
loginAccountMarkets,
loginAccountReports
orderCancellation
};

@@ -5,6 +5,3 @@ import React, { PropTypes } from 'react';

const ValueDenomination = (p) => (
<span
className={classnames('value-denomination', p.className, { positive: p.formattedValue > 0, negative: p.formattedValue < 0 })}
title={p.title && p.title || ''}
>
<span className={classnames('value-denomination', p.className, { positive: p.formattedValue > 0, negative: p.formattedValue < 0 })}>
{p.prefix &&

@@ -28,6 +25,5 @@ <span className="prefix">{p.prefix}</span>

denomination: PropTypes.string,
prefix: PropTypes.string,
title: PropTypes.string
prefix: PropTypes.string
};
export default ValueDenomination;

@@ -6,161 +6,171 @@ import React, { PropTypes } from 'react';

import Input from '../../common/components/input';
import Checkbox from '../../../modules/common/components/checkbox';
const CreateMarketForm4 = (p) => {
const advancedParamsArrow = !!p.showAdvancedMarketParams ? '▲' : '▼';
return (
<div className="step-4">
<div className="fee">
<h4>Set the taker's fee</h4>
<p>
The taker fee is a percentage fee charged to the 'Taker' against the value of any trade made in the market.
</p>
<Input
type="text"
value={p.takerFee}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ takerFee: value })}
/>
<span className="denomination">%</span>
{p.errors.takerFee &&
<span className="error-message">{p.errors.takerFee}</span>
}
</div>
<div className="fee">
<h4>Set the maker's fee</h4>
<p>
The maker fee is a percentage fee charged to the 'Maker' against the value of any trade made in the market.
</p>
<Input
type="text"
value={p.makerFee}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ makerFee: value })}
/>
<span className="denomination">%</span>
{p.errors.makerFee &&
<span className="error-message">{p.errors.makerFee}</span>
}
</div>
<div className="liquidity">
<h4>Set the amount of initial liquidity</h4>
<p>
Initial liquidity is the amount of ether you're putting into the market to get trading started.
The Market Maker will use these funds to buy shares - which are then sold back to those
wanting to trade your market when the market opens. Any initial liquidity remaining when
the market is expired will be returned to you (along with any profit generated by the Market
Maker from selling shares).
</p>
<Input
type="text"
value={p.initialLiquidity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ initialLiquidity: value })}
/>
<span className="denomination">ETH</span>
{p.errors.initialLiquidity &&
<span className="error-message">{p.errors.initialLiquidity}</span>
}
</div>
<div className="advanced-market-params" >
<h6 className="horizontal-divider" onClick={() => { p.onValuesUpdated({ showAdvancedMarketParams: !p.showAdvancedMarketParams }); }}><span>{advancedParamsArrow}</span> Advanced <span>{advancedParamsArrow}</span></h6>
<div className={classNames({ displayNone: !p.showAdvancedMarketParams })}>
<div>
<h4>Initial Fair Price</h4>
<p>
This establishes the initial price for each respective outcome.
</p>
{p.initialFairPrices.values.map((cV, i) =>
(<div key={`initialFairPrice${i}`} >
<Input
type="text"
value={p.initialFairPrices.values[i].value}
isClearable={false}
onChange={
(onChangeValue) => {
const prices = p.initialFairPrices.values;
const raw = p.initialFairPrices.raw;
prices[i].value = onChangeValue;
raw[i] = onChangeValue;
p.onValuesUpdated({
initialFairPrices: {
...p.initialFairPrices,
values: prices,
raw
}
});
}
const CreateMarketForm4 = (p) => (
<div className="step-4">
<div className="fee">
<h4>Set the taker's fee</h4>
<p>
The taker fee is a percentage fee charged to the 'Taker' against the value of any trade made in the market.
</p>
<Input
type="text"
value={p.takerFee}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ takerFee: value })}
/>
<span className="denomination">%</span>
{p.errors.takerFee &&
<span className="error-message">{p.errors.takerFee}</span>
}
</div>
<div className="fee">
<h4>Set the maker's fee</h4>
<p>
The maker fee is a percentage fee charged to the 'Maker' against the value of any trade made in the market.
</p>
<Input
type="text"
value={p.makerFee}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ makerFee: value })}
/>
<span className="denomination">%</span>
{p.errors.makerFee &&
<span className="error-message">{p.errors.makerFee}</span>
}
</div>
<div className="initial-order-book">
<h4>Set the initial order book</h4>
<p>
Allows you to place an initial set of orders in this market's order book, which will allow traders to begin buying and selling immediately.
</p>
<Checkbox
text="Include initial order book"
isChecked={p.isCreatingOrderBook}
onClick={() => p.onValuesUpdated({ isCreatingOrderBook: !p.isCreatingOrderBook })}
/>
</div>
<div className={classNames('order-book-creation', { displayNone: !p.isCreatingOrderBook })} >
<h6 className="horizontal-divider" > Order Book Creation </h6>
<div>
<div className="liquidity">
<h4>Set the amount of initial liquidity</h4>
<p>
Initial liquidity is the amount of ether you're putting into the market to get trading started.
The Market Maker will use these funds to buy shares - which are then sold back to those
wanting to trade your market when the market opens. Any initial liquidity remaining when
the market is expired will be returned to you (along with any profit generated by the Market
Maker from selling shares).
</p>
<Input
type="text"
value={p.initialLiquidity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ initialLiquidity: value })}
/>
<span className="denomination">ETH</span>
{p.errors.initialLiquidity &&
<span className="error-message">{p.errors.initialLiquidity}</span>
}
</div>
<div>
<h4>Initial Fair Price</h4>
<p>
This establishes the initial price for each respective outcome.
</p>
{p.initialFairPrices.values.map((cV, i) =>
(<div key={`initialFairPrice${i}`} >
<Input
type="text"
value={p.initialFairPrices.values[i].value}
isClearable={false}
onChange={
(onChangeValue) => {
const prices = p.initialFairPrices.values;
const raw = p.initialFairPrices.raw;
prices[i].value = onChangeValue;
raw[i] = onChangeValue;
p.onValuesUpdated({
initialFairPrices: {
...p.initialFairPrices,
values: prices,
raw
}
});
}
/>
<span className="denomination">ETH | {cV.label}</span>
{!!get(p.errors, `initialFairPrice.${i}`) &&
<span className="error-message">
{p.errors.initialFairPrice[`${i}`]}
</span>
}
</div>)
)}
</div>
<div>
<h4>Best Bid/Ask Quantity</h4>
<p>
This defines the number of shares applied to the best bid and ask orders.
</p>
<Input
type="text"
value={p.bestStartingQuantity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ bestStartingQuantity: value })}
/>
<span className="denomination">Shares</span>
{p.errors.bestStartingQuantity &&
<span className="error-message">
{p.errors.bestStartingQuantity}
</span>
}
</div>
<div>
<h4>Starting Quantity</h4>
<p>
This is the number of shares in each order.
</p>
<Input
type="text"
value={p.startingQuantity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ startingQuantity: value })}
/>
<span className="denomination">Shares</span>
{p.errors.startingQuantity &&
<span className="error-message">
{p.errors.startingQuantity}
</span>
}
</div>
<div>
<h4>Price Width</h4>
<p>
This defines the spread between the initial best bid and ask orders.
</p>
<Input
type="text"
value={p.priceWidth}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ priceWidth: value })}
/>
<span className="denomination">ETH</span>
{p.errors.priceWidth &&
<span className="error-message">{p.errors.priceWidth}</span>
}
</div>
/>
<span className="denomination">ETH | {cV.label}</span>
{!!get(p.errors, `initialFairPrice.${i}`) &&
<span className="error-message">
{p.errors.initialFairPrice[`${i}`]}
</span>
}
</div>)
)}
</div>
<div>
<h4>Best Bid/Ask Quantity</h4>
<p>
This defines the number of shares applied to the best bid and ask orders.
</p>
<Input
type="text"
value={p.bestStartingQuantity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ bestStartingQuantity: value })}
/>
<span className="denomination">Shares</span>
{p.errors.bestStartingQuantity &&
<span className="error-message">
{p.errors.bestStartingQuantity}
</span>
}
</div>
<div>
<h4>Starting Quantity</h4>
<p>
This is the number of shares in each order.
</p>
<Input
type="text"
value={p.startingQuantity}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ startingQuantity: value })}
/>
<span className="denomination">Shares</span>
{p.errors.startingQuantity &&
<span className="error-message">
{p.errors.startingQuantity}
</span>
}
</div>
<div>
<h4>Price Width</h4>
<p>
This defines the spread between the initial best bid and ask orders.
</p>
<Input
type="text"
value={p.priceWidth}
isClearable={false}
onChange={(value) => p.onValuesUpdated({ priceWidth: value })}
/>
<span className="denomination">ETH</span>
{p.errors.priceWidth &&
<span className="error-message">{p.errors.priceWidth}</span>
}
</div>
</div>
<FormButtons
disabled={!p.isValid}
nextLabel="review"
onNext={() => p.onValuesUpdated({ step: p.step + 1 })}
onPrev={() => p.onValuesUpdated({ step: p.step - 1 })}
/>
</div>
);
};
<FormButtons
disabled={!p.isValid}
nextLabel="review"
onNext={() => p.onValuesUpdated({ step: p.step + 1 })}
onPrev={() => p.onValuesUpdated({ step: p.step - 1 })}
/>
</div>
);

@@ -167,0 +177,0 @@ CreateMarketForm4.propTypes = {

@@ -7,3 +7,3 @@ import React, { Component, PropTypes } from 'react';

import Link from '../../link/components/link';
import Advanced from '../../market/components/advanced';
import OrderBookParameters from '../../../modules/market/components/order-book-parameters';

@@ -32,3 +32,2 @@ export default class MarketItem extends Component {

const p = this.props;
const advancedParamsArrow = !!p.showAdvancedMarketParams ? '▲' : '▼';

@@ -40,7 +39,7 @@ return (

{!!p.creatingMarket &&
<div className="advanced-market-params" >
<h6 className="horizontal-divider" onClick={() => { p.onValuesUpdated({ showAdvancedMarketParams: !p.showAdvancedMarketParams }); }}><span>{advancedParamsArrow}</span> Advanced <span>{advancedParamsArrow}</span></h6>
<div className={classnames({ displayNone: !p.showAdvancedMarketParams })}>
<Advanced {...p} />
{!!p.creatingMarket && p.isCreatingOrderBook &&
<div className="order-book-creation" >
<h6 className="horizontal-divider" > Order Book Parameters </h6>
<div>
<OrderBookParameters {...p} />
</div>

@@ -47,0 +46,0 @@ </div>

@@ -25,3 +25,3 @@ import React, { Component, PropTypes } from 'react';

return (
<header className="header-bar markets-header">
<header className="markets-header">
<div className={classnames('markets-header-item', 'all-markets', { active: !p.selectedMarketsHeader })} onClick={p.onClickAllMarkets}>

@@ -28,0 +28,0 @@ <span className="name">Markets</span>

@@ -5,3 +5,3 @@ import React, { Component, PropTypes } from 'react';

import SiteFooter from '../../site/components/site-footer';
import SearchSort from '../../../modules/common/components/search-sort';
import SearchSort from '../../markets/components/search-sort';
import Markets from '../../markets/components/markets';

@@ -8,0 +8,0 @@

@@ -9,3 +9,3 @@ import React from 'react';

<section className={p.className}>
<div className="component-header">
<div className="markets-header-bar">
<Link className="button make" {...p.createMarketLink}>

@@ -12,0 +12,0 @@ Make a Market

import React from 'react';
import classnames from 'classnames';
import { ACCOUNT, MARKETS, TRANSACTIONS, MY_POSITIONS, MY_MARKETS, MY_REPORTS } from '../../site/constants/pages';
import { ACCOUNT, MARKETS, POSITIONS, TRANSACTIONS } from '../../site/constants/pages';
import { AUTH_TYPES } from '../../auth/constants/auth-types';

@@ -15,15 +15,24 @@ import Link from '../../link/components/link';

{!!p.loginAccount && !!p.loginAccount.id && !!p.portfolioTotals &&
<Link className={classnames('site-nav-link', MY_POSITIONS, { active: [MY_POSITIONS, MY_MARKETS, MY_REPORTS].indexOf(p.activePage) > -1 })} {...p.myPositionsLink}>
<ValueDenomination
title={`Total Portfolio Value: ${p.portfolioTotals.value.full}`}
{...p.portfolioTotals.value || {}}
/> Portfolio (
<ValueDenomination
title={`Total Portfolio Gain/Loss: ${p.portfolioTotals.net.full}`}
{...p.portfolioTotals.net || {}}
/>)
{!!p.loginAccount && !!p.loginAccount.id && !!p.positionsSummary && !!p.positionsSummary.numPositions &&
<Link className={classnames('site-nav-link', POSITIONS, { active: p.activePage === POSITIONS })} {...p.positionsLink}>
{!!p.positionsSummary &&
<ValueDenomination
className="positions-num"
{...p.positionsSummary.numPositions}
formatted={p.positionsSummary.numPositions.rounded}
formattedValue={p.positionsSummary.numPositions.roundedValue}
/>
}
{!!p.positionsSummary && !!p.positionsSummary.gainPercent && p.positionsSummary.numPositions.roundedValue > 0 &&
<ValueDenomination
className="positions-gain"
{...p.positionsSummary.gainPercent}
formatted={p.positionsSummary.gainPercent.rounded}
formattedValue={p.positionsSummary.gainPercent.roundedValue}
/>
}
</Link>
}
{(!!p.loginAccount && !!p.loginAccount.id || !!p.transactionsTotals.numTotal) &&

@@ -74,11 +83,11 @@ <Link

loginAccount: React.PropTypes.object,
positionsSummary: React.PropTypes.object,
transactionsTotals: React.PropTypes.object,
isTransactionsWorking: React.PropTypes.bool,
marketsLink: React.PropTypes.object,
myPositionsLink: React.PropTypes.object,
positionsLink: React.PropTypes.object,
transactionsLink: React.PropTypes.object,
authLink: React.PropTypes.object,
portfolioTotals: React.PropTypes.object
authLink: React.PropTypes.object
};
export default SiteHeader;
export const MARKETS = 'markets';
export const MAKE = 'make';
export const POSITIONS = 'positions';
export const TRANSACTIONS = 'transactions';
export const M = 'm';
export const ACCOUNT = 'account';
export const MY_POSITIONS = 'my-positions';
export const MY_MARKETS = 'my-markets';
export const MY_REPORTS = 'my-reports';
export const DEFAULT_PAGE = MARKETS;

@@ -116,7 +116,3 @@ import React from 'react';

{p.status &&
<div className="status-and-message">
<span className="message">{p.message}</span>
<br />
<span className="status">{p.status}</span>
</div>
<div className="status-and-message"><span className="status">{p.status}</span><br /><span className="message">{p.message}</span></div>
}

@@ -123,0 +119,0 @@ </article>

@@ -12,11 +12,7 @@ import activePage from './selectors/active-page';

import marketsTotals from './selectors/markets-totals';
import positionsMarkets from './selectors/positions-markets';
import positionsSummary from './selectors/positions-summary';
import transactions from './selectors/transactions';
import transactionsTotals from './selectors/transactions-totals';
import url from './selectors/url';
import portfolio from './selectors/portfolio';
import portfolioNavItems from './selectors/portfolio-nav-items';
import portfolioTotals from './selectors/portfolio-totals';
import loginAccountPositions from './selectors/login-account-positions';
import loginAccountMarkets from './selectors/login-account-markets';
import loginAccountReports from './selectors/login-account-reports';

@@ -36,11 +32,7 @@ // all selectors should go here

marketsTotals,
positionsSummary,
positionsMarkets,
transactions,
transactionsTotals,
url,
portfolio,
portfolioNavItems,
portfolioTotals,
loginAccountPositions,
loginAccountMarkets,
loginAccountReports
url
};

@@ -47,0 +39,0 @@

@@ -95,2 +95,3 @@ import { BINARY, CATEGORICAL, SCALAR } from '../modules/markets/constants/market-types';

form.makerFeePercent = makeNumber(form.makerFee, '%');
form.initialLiquidityFormatted = makeNumber(form.initialLiquidity, 'ETH', true);
form.bestStartingQuantityFormatted = makeNumber(form.bestStartingQuantity, 'Shares', true);

@@ -97,0 +98,0 @@ form.startingQuantityFormatted = makeNumber(form.startingQuantity, 'Shares', true);

@@ -1,2 +0,2 @@

import { ACCOUNT, MARKETS, MAKE, TRANSACTIONS, M, MY_POSITIONS, MY_MARKETS, MY_REPORTS } from '../modules/site/constants/pages';
import { ACCOUNT, MARKETS, MAKE, POSITIONS, TRANSACTIONS, M } from '../modules/site/constants/pages';
import { LOGIN } from '../modules/auth/constants/auth-types';

@@ -7,2 +7,3 @@

marketsLink: { href: '/', onClick: (url) => require('../selectors').update({ activePage: MARKETS, url }) },
positionsLink: { href: '/portfolio', onClick: (url) => require('../selectors').update({ activePage: POSITIONS, url }) },
transactionsLink: { href: '/transactions', onClick: (url) => require('../selectors').update({ activePage: TRANSACTIONS, url }) },

@@ -12,6 +13,3 @@ marketLink: { href: '/market', onClick: (url) => require('../selectors').update({ activePage: M, url }) },

createMarketLink: { href: '/create', onClick: (url) => require('../selectors').update({ activePage: MAKE, url }) },
accountLink: { href: '/account', onClick: (url) => require('../selectors').update({ activePage: ACCOUNT, url }) },
myPositionsLink: { href: '/my-positions', onClick: (url) => require('../selectors').update({ activePage: MY_POSITIONS, url }) },
myMarketsLink: { href: '/my-markets', onClick: (url) => require('../selectors').update({ activePage: MY_MARKETS, url }) },
myReportsLink: { href: '/my-reports', onClick: (url) => require('../selectors').update({ activePage: MY_REPORTS, url }) }
accountLink: { href: '/account', onClick: (url) => require('../selectors').update({ activePage: ACCOUNT, url }) }
};
import { makeNumber } from '../utils/make-number';
import { makeDate } from '../utils/make-date';
import selectOrderBook from '../selectors/bids-asks/select-bids-asks';

@@ -33,3 +32,7 @@

description: `Will the dwerps achieve a mwerp by the end of zwerp ${(index + 1)}?`,
endDate: makeDate(d),
endDate: {
value: d,
formatted: `${d.getFullYear()}/${d.getMonth()}/${d.getDate()}`,
full: d.toISOString()
},
endDateLabel: (d < new Date()) ? 'ended' : 'ends',

@@ -36,0 +39,0 @@ takerFeePercent: makeNumber(randomInt(1, 10), '%', true),

@@ -30,4 +30,3 @@ export default [

},
status: 'processing buy...',
message: 'buying 10 shares @ 0.67eth',
status: 'processing...',
id: '1385867-1469682892056'

@@ -102,3 +101,3 @@ },

address: '0xbf824e58631c5f8a8d3c2dca4dc1e5b99852ecd0',
message: 'loaded free ether and rep',
message: 'Loaded free ether and rep',
status: 'success',

@@ -105,0 +104,0 @@ id: '1385715-1469680758488'

import { assert } from 'chai';
export default function (endDate, label = 'Formatted Date'){
describe(label, () => {
export default function (endDate, refObj){
describe(`${refObj}'s endDate`, () => {
describe('value', () => {

@@ -6,0 +6,0 @@ it('should exist', () => {

import { assert } from 'chai';
export default function (actual, label = 'Formatted Number') {
export default function (actual, label = 'Formatted number') {
describe(label, () => {

@@ -5,0 +5,0 @@ describe('value', () => {

@@ -239,65 +239,67 @@ import { assert } from 'chai';

describe('initialLiquidity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialLiquidity, `'initialLiquidity' is not defined`);
});
if(createMarketForm.isCreatingOrderBook){
describe('initialLiquidity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialLiquidity, `'initialLiquidity' is not defined`);
});
it('should be a number', () => {
assert.isNumber(createMarketForm.initialLiquidity, `'initialLiquidity' is not a number`);
it('should be a number', () => {
assert.isNumber(createMarketForm.initialLiquidity, `'initialLiquidity' is not a number`);
});
});
});
describe('initialFairPrices', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialFairPrices, `'initialFairPrices' is not defined`);
});
describe('initialFairPrices', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialFairPrices, `'initialFairPrices' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.initialFairPrices, `'initialFairPrices' is not an object`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.initialFairPrices, `'initialFairPrices' is not an object`);
});
it('should have the correct shape', () => {
assertInitialFairPrices(createMarketForm.initialFairPrices, 'createMarketForm');
it('should have the correct shape', () => {
assertInitialFairPrices(createMarketForm.initialFairPrices, 'createMarketForm');
});
});
});
describe('bestStartingQuantity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.bestStartingQuantity, `'bestStartingQuantity' is not defined`);
});
describe('bestStartingQuantity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.bestStartingQuantity, `'bestStartingQuantity' is not defined`);
});
it('should be a number', () => {
assert.isNumber(createMarketForm.bestStartingQuantity, `'bestStartingQuantity' is not a number`);
it('should be a number', () => {
assert.isNumber(createMarketForm.bestStartingQuantity, `'bestStartingQuantity' is not a number`);
});
});
});
describe('startingQuantity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.startingQuantity, `'startingQuantity' is not defined`);
});
describe('startingQuantity', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.startingQuantity, `'startingQuantity' is not defined`);
});
it('should be a number', () => {
assert.isNumber(createMarketForm.startingQuantity, `'startingQuantity' is not a number`);
it('should be a number', () => {
assert.isNumber(createMarketForm.startingQuantity, `'startingQuantity' is not a number`);
});
});
});
describe('priceWidth', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceWidth, `'priceWidth' is not defined`);
});
describe('priceWidth', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceWidth, `'priceWidth' is not defined`);
});
it('should be a number', () => {
assert.isNumber(createMarketForm.priceWidth, `'priceWidth' is not a number`);
it('should be a number', () => {
assert.isNumber(createMarketForm.priceWidth, `'priceWidth' is not a number`);
});
});
});
describe('priceDepth', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceDepth, `'priceDepth' is not defined`);
});
describe('priceDepth', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceDepth, `'priceDepth' is not defined`);
});
it('should be a number', () => {
assert.isNumber(createMarketForm.priceDepth, `'priceDepth' is not a number`);
it('should be a number', () => {
assert.isNumber(createMarketForm.priceDepth, `'priceDepth' is not a number`);
});
});
});
}

@@ -393,57 +395,73 @@ break;

describe('initialFairPrices', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialFairPrices, `'initialFairPrices' is not defined`);
});
if(createMarketForm.isCreatingOrderBook) {
describe('initialFairPrices', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialFairPrices, `'initialFairPrices' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.initialFairPrices, `'initialFairPrices' is not an object`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.initialFairPrices, `'initialFairPrices' is not an object`);
});
it('should have the correct shape', () => {
assertInitialFairPrices(createMarketForm.initialFairPrices, 'createMarketForm.initialFairPrices');
it('should have the correct shape', () => {
assertInitialFairPrices(createMarketForm.initialFairPrices, 'createMarketForm.initialFairPrices');
});
});
});
describe('bestStartingQuantityFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.bestStartingQuantityFormatted, `'bestStartingQuantityFormatted' is not defined`);
});
describe('priceWidthFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.initialLiquidityFormatted, `'initialLiquidityFormatted' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.bestStartingQuantityFormatted, `'bestStartingQuantityFormatted' is not an object`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.initialLiquidityFormatted, `'initialLiquidityFormatted' is not an object`);
});
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.bestStartingQuantityFormatted, 'createMarketForm.bestStartingQuantityFormatted');
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.initialLiquidityFormatted, 'createMarketForm.initialLiquidityFormatted');
});
});
});
describe('startingQuantityFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.startingQuantityFormatted, `'startingQuantityFormatted' is not defined`);
});
describe('priceWidthFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceWidthFormatted, `'priceWidthFormatted' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.startingQuantityFormatted, `'startingQuantityFormatted' is not an object`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.priceWidthFormatted, `'priceWidthFormatted' is not an object`);
});
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.startingQuantityFormatted, 'createMarketForm.startingQuantityFormatted');
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.priceWidthFormatted, 'createMarketForm.priceWidthFormatted');
});
});
});
describe('priceWidthFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.priceWidthFormatted, `'priceWidthFormatted' is not defined`);
});
describe('bestStartingQuantityFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.bestStartingQuantityFormatted, `'bestStartingQuantityFormatted' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.priceWidthFormatted, `'priceWidthFormatted' is not an object`);
it('should be an object', () => {
assert.isObject(createMarketForm.bestStartingQuantityFormatted, `'bestStartingQuantityFormatted' is not an object`);
});
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.bestStartingQuantityFormatted, 'createMarketForm.bestStartingQuantityFormatted');
});
});
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.priceWidthFormatted, 'createMarketForm.priceWidthFormatted');
describe('startingQuantityFormatted', () => {
it('should be defined', () => {
assert.isDefined(createMarketForm.startingQuantityFormatted, `'startingQuantityFormatted' is not defined`);
});
it('should be an object', () => {
assert.isObject(createMarketForm.startingQuantityFormatted, `'startingQuantityFormatted' is not an object`);
});
it('should have the correct shape', () => {
assertFormattedNumber(createMarketForm.startingQuantityFormatted, 'createMarketForm.startingQuantityFormatted');
});
});
});
}
}

@@ -450,0 +468,0 @@ });

import { assert } from 'chai';
import assertLink from '../../test/assertions/common/link';
export default function(links) {
describe('augur-ui-react-components links state', () => {
assert.isDefined(links, `links isn't defined`);
assert.isObject(links, `links isn't an object`);
assert.isDefined(links, `links isn't defined`);
assert.isObject(links, `links isn't an object`);
it('authLink', () => {
assertLink(links.authLink, 'links');
});
var authLink = links.authLink;
assert.isDefined(authLink, `links.authLink isn't defined`);
assert.isObject(authLink, `links.authLink isn't an object`);
assert.isDefined(authLink.href, `links.authLink.href isn't defined`);
assert.isString(authLink.href, `links.authLink.href isn't a string`);
assert.isDefined(authLink.onClick, `links.authLink.onClick isn't defined`);
assert.isFunction(authLink.onClick, `links.authLink.onClick isn't a function`);
it('marketsLink', () => {
assertLink(links.marketsLink, 'links');
});
var marketsLink = links.marketsLink;
assert.isDefined(marketsLink, `links.marketsLink isn't defined`);
assert.isObject(marketsLink, `links.marketsLink isn't an object`);
assert.isDefined(marketsLink.href, `links.marketsLink.href isn't defined`);
assert.isString(marketsLink.href, `links.marketsLink.href isn't a string`);
assert.isDefined(marketsLink.onClick, `links.marketsLink.onClick isn't defined`);
assert.isFunction(marketsLink.onClick, `links.marketsLink.onClick isn't a function`);
it('transactionsLink', () => {
assertLink(links.transactionsLink, 'links');
});
var positionsLink = links.positionsLink;
assert.isDefined(positionsLink, `links.positionsLink isn't defined`);
assert.isObject(positionsLink, `links.positionsLink isn't an object`);
assert.isDefined(positionsLink.href, `links.positionsLink.href isn't defined`);
assert.isString(positionsLink.href, `links.positionsLink.href isn't a string`);
assert.isDefined(positionsLink.onClick, `links.positionsLink.onClick isn't defined`);
assert.isFunction(positionsLink.onClick, `links.positionsLink.onClick isn't a function`);
it('marketLink', () => {
assertLink(links.marketLink, 'links');
});
var transactionsLink = links.transactionsLink;
assert.isDefined(transactionsLink, `links.transactionsLink isn't defined`);
assert.isObject(transactionsLink, `links.transactionsLink isn't an object`);
assert.isDefined(transactionsLink.href, `links.transactionsLink.href isn't defined`);
assert.isString(transactionsLink.href, `links.transactionsLink.href isn't a string`);
assert.isDefined(transactionsLink.onClick, `links.transactionsLink.onClick isn't defined`);
assert.isFunction(transactionsLink.onClick, `links.transactionsLink.onClick isn't a function`);
it('previousLink', () => {
assertLink(links.previousLink, 'links');
});
var marketLink = links.marketLink;
assert.isDefined(marketLink, `links.marketLink isn't defined`);
assert.isObject(marketLink, `links.marketLink isn't an object`);
assert.isDefined(marketLink.href, `links.marketLink.href isn't defined`);
assert.isString(marketLink.href, `links.marketLink.href isn't a string`);
assert.isDefined(marketLink.onClick, `links.marketLink.onClick isn't defined`);
assert.isFunction(marketLink.onClick, `links.marketLink.onClick isn't a function`);
it('createMarketLink', () => {
assertLink(links.createMarketLink, 'links');
});
});
var previousLink = links.previousLink;
assert.isDefined(previousLink, `links.previousLink isn't defined`);
assert.isObject(previousLink, `links.previousLink isn't an object`);
assert.isDefined(previousLink.href, `links.previousLink.href isn't defined`);
assert.isString(previousLink.href, `links.previousLink.href isn't a string`);
assert.isDefined(previousLink.onClick, `links.previousLink.onClick isn't defined`);
assert.isFunction(previousLink.onClick, `links.previousLink.onClick isn't a function`);
var createMarketLink = links.createMarketLink;
assert.isDefined(createMarketLink, `links.createMarketLink isn't defined`);
assert.isObject(createMarketLink, `links.createMarketLink isn't an object`);
assert.isDefined(createMarketLink.href, `links.createMarketLink.href isn't defined`);
assert.isString(createMarketLink.href, `links.createMarketLink.href isn't a string`);
assert.isDefined(createMarketLink.onClick, `links.createMarketLink.onClick isn't defined`);
assert.isFunction(createMarketLink.onClick, `links.createMarketLink.onClick isn't a function`);
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc