diff --git a/packages/app-testing/src/Account/index.js b/packages/app-testing/src/Account/index.js index 9673ca71d2..b4806bf4ab 100644 --- a/packages/app-testing/src/Account/index.js +++ b/packages/app-testing/src/Account/index.js @@ -20,7 +20,13 @@ type Props = BaseProps & { }; export default function Account ({ className, label, subject, style }: Props) { - const AccountBalance = withObservableParams(Balance, subject); + const AccountBalance = withObservableParams(Balance, subject, (pair: KeyringPair) => { + if (!pair) { + return new Uint8Array([]); + } + + return pair.publicKey(); + }); return (
+
); diff --git a/packages/app-testing/src/CallDisplay/index.js b/packages/app-testing/src/CallDisplay/index.js index 9444d6904c..0e70fe7ea3 100644 --- a/packages/app-testing/src/CallDisplay/index.js +++ b/packages/app-testing/src/CallDisplay/index.js @@ -29,6 +29,9 @@ function CallDisplay ({ className, style, value }: Props) { } const Component = COMPONENTS[value] || ErrorComponent; + const onSubmit = () => { + console.log('getValues', Component.getValues()); + }; return (
); } + +StakingTransfer.getValues = getValues; + +export default StakingTransfer; diff --git a/packages/app-testing/src/StakingTransfer/subject/amount.js b/packages/app-testing/src/StakingTransfer/subject/amount.js new file mode 100644 index 0000000000..1e5f08c17b --- /dev/null +++ b/packages/app-testing/src/StakingTransfer/subject/amount.js @@ -0,0 +1,10 @@ +// Copyright 2017-2018 Jaco Greeff +// This software may be modified and distributed under the terms +// of the ISC license. See the LICENSE file for details. +// @flow + +import { BehaviorSubject } from 'rxjs/BehaviorSubject'; + +const subject = new BehaviorSubject(); + +export default subject; diff --git a/packages/app-testing/src/subject/addr.js b/packages/app-testing/src/subject/addr.js deleted file mode 100644 index 6ec66373fa..0000000000 --- a/packages/app-testing/src/subject/addr.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017-2018 Jaco Greeff -// This software may be modified and distributed under the terms -// of the ISC license. See the LICENSE file for details. -// @flow - -import type { KeyringPair } from '@polkadot/uti-keyring/types'; - -import { map } from 'rxjs/operators/map'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; - -export default function addr (): $rxjs$ReplaySubject { - return new ReplaySubject(1).pipe( - map((pair: KeyringPair) => { - if (!pair) { - return new Uint8Array([]); - } - - return pair.publicKey(); - }) - ); -} diff --git a/packages/app-testing/src/subject/addrRecipient.js b/packages/app-testing/src/subject/addrRecipient.js index 8dca03239f..1e5f08c17b 100644 --- a/packages/app-testing/src/subject/addrRecipient.js +++ b/packages/app-testing/src/subject/addrRecipient.js @@ -3,8 +3,8 @@ // of the ISC license. See the LICENSE file for details. // @flow -import addr from './addr'; +import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -const subject = addr(); +const subject = new BehaviorSubject(); export default subject; diff --git a/packages/app-testing/src/subject/addrSender.js b/packages/app-testing/src/subject/addrSender.js index 8dca03239f..1e5f08c17b 100644 --- a/packages/app-testing/src/subject/addrSender.js +++ b/packages/app-testing/src/subject/addrSender.js @@ -3,8 +3,8 @@ // of the ISC license. See the LICENSE file for details. // @flow -import addr from './addr'; +import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -const subject = addr(); +const subject = new BehaviorSubject(); export default subject;