Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Revert "Merge pull request #2676 from bandprotocol/cypress-setup"
Browse files Browse the repository at this point in the history
This reverts commit 18774ae, reversing
changes made to 9e3d6ba.
  • Loading branch information
evilpeach committed Oct 2, 2020
1 parent 6ca3a55 commit 94a08e7
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 1,086 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,11 @@ jobs:
path: scan/node_modules
key: ${{ runner.OS }}-scan-test-${{ hashFiles('**/yarn.lock') }}

- name: Yarn install deps with node_modules cache
run: |
yarn install --frozen-lockfile
- name: Run yarn
if: steps.scan-node-modules-cache.outputs.cache-hit != 'true'
run: yarn
working-directory: ${{env.working-directory}}

- name: Run yarn build
run: yarn build
env:
RPC_URL: "https://d3n.bandprotocol.com/rest"
GRAPHQL_URL: "wss://d3n.bandprotocol.com/v1/graphql"
NETWORK: "GUANYU38"
working-directory: ${{env.working-directory}}

# - name: Run install cypress
# run: yarn cypress install
# working-directory: ${{env.working-directory}}

- name: Run yarn test
run: yarn test
working-directory: ${{env.working-directory}}

# - name: Run yarn integration-test
# run: yarn integration-test
# working-directory: ${{env.working-directory}}
1 change: 0 additions & 1 deletion CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
- (impv) [\#2689](https://github.com/bandprotocol/bandchain/pull/2689) Styled the top part of account index page
- (bugs) [\#2687](https://github.com/bandprotocol/bandchain/pull/2687) Fixed NaN number (Urgent)
- (impv) [\#2684](https://github.com/bandprotocol/bandchain/pull/2684) Adjust validator voted from 250 to 100
- (impv) [\#2676](https://github.com/bandprotocol/bandchain/pull/2676) Setup cypress to scan, added new sendToken testcase
- (bugs) [\#2673](https://github.com/bandprotocol/bandchain/pull/2673) Fixed sorting on moniker with emoji
- (impv) [\#2672](https://github.com/bandprotocol/bandchain/pull/2672) Hid the proposal desc from tx index page table
- (impv) [\#2671](https://github.com/bandprotocol/bandchain/pull/2671) Adjusted tooltip width and added webapi
Expand Down
6 changes: 0 additions & 6 deletions scan/cypress.json

This file was deleted.

36 changes: 0 additions & 36 deletions scan/cypress/integration/send_action.spec.js

This file was deleted.

25 changes: 0 additions & 25 deletions scan/cypress/support/commands.js

This file was deleted.

20 changes: 0 additions & 20 deletions scan/cypress/support/index.js

This file was deleted.

16 changes: 3 additions & 13 deletions scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"scripts": {
"build": "rm -rf dist/ && bsb -make-world && parcel build index.html --no-source-maps --no-cache",
"start": "bsb -make-world -w",
"test": "yarn jest --coverage",
"cy:run": "cypress run",
"serve:build": "serve -s dist -l 3000",
"integration-test": "start-server-and-test 'yarn run serve:build' http://localhost:3000 cy:run"
"test:dev": "yarn jest --coverage",
"test": "yarn build && yarn test:dev"
},
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
Expand Down Expand Up @@ -55,15 +53,12 @@
"bs-platform": "^7.0.1",
"bsb-js": "^1.1.7",
"css-loader": "^4.3.0",
"cypress": "^5.2.0",
"html-webpack-plugin": "^4.5.0",
"parcel-bundler": "^1.12.4",
"style-loader": "^1.2.1",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"serve": "^11.3.0",
"start-server-and-test": "^1.11.0"
"webpack-dev-server": "^3.11.0"
},
"customDistStructure": {
"config": {
Expand All @@ -76,10 +71,5 @@
".gif"
]
}
},
"jest": {
"testPathIgnorePatterns": [
"cypress"
]
}
}
2 changes: 0 additions & 2 deletions scan/src/components/EnhanceTxInput.re
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ let make =
~placeholder="",
~inputType="text",
~autoFocus=false,
~id,
) => {
let (status, setStatus) = React.useState(_ => Untouched);

Expand All @@ -102,7 +101,6 @@ let make =
<Text value=msg size=Text.Lg spacing={Text.Em(0.03)} nowrap=true block=true />
<div className={Styles.rightContainer(width)}>
<input
id
value={inputData.text}
className={Css.merge([Styles.input, code ? Styles.code : ""])}
placeholder
Expand Down
48 changes: 21 additions & 27 deletions scan/src/components/UserAccount.re
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module ConnectBtn = {
[@react.component]
let make = (~connect) => {
<div
id="connectButton"
className={Css.merge([
CssHelper.flexBox(~justify=`center, ~align=`center, ()),
CssHelper.clickable,
Expand Down Expand Up @@ -86,35 +85,31 @@ module FaucetBtn = {
let (isRequest, setIsRequest) = React.useState(_ => false);
isRequest
? <img src=Images.loadingCircles className=Styles.loading />
: <div id="getFreeButton">
<Button
px=20
py=5
variant=Button.Outline
onClick={_ => {
setIsRequest(_ => true);
let _ =
AxiosFaucet.request({address: address |> Address.toBech32, amount: 10_000_000})
|> Js.Promise.then_(_ => {
setIsRequest(_ => false);
Js.Promise.resolve();
});
();
}}>
<Text value="Get 10 Testnet BAND" weight=Text.Medium nowrap=true />
</Button>
</div>;
: <Button
px=20
py=5
variant=Button.Outline
onClick={_ => {
setIsRequest(_ => true);
let _ =
AxiosFaucet.request({address: address |> Address.toBech32, amount: 10_000_000})
|> Js.Promise.then_(_ => {
setIsRequest(_ => false);
Js.Promise.resolve();
});
();
}}>
<Text value="Get 10 Testnet BAND" weight=Text.Medium nowrap=true />
</Button>;
};
};

module SendBtn = {
[@react.component]
let make = (~send) => {
<div id="sendToken">
<Button px=20 py=5 onClick={_ => {send()}}>
<Text value="Send" weight=Text.Medium nowrap=true block=true />
</Button>
</div>;
<Button px=20 py=5 onClick={_ => {send()}}>
<Text value="Send" weight=Text.Medium nowrap=true block=true />
</Button>;
};
};

Expand All @@ -125,7 +120,7 @@ module Balance = {

<div className={CssHelper.flexBox(~justify=`spaceBetween, ())}>
<Text value="Balance" weight=Text.Medium />
<div className={CssHelper.flexBox()} id="bandBalance">
<div className={CssHelper.flexBox()}>
<Text
value={
switch (accountSub) {
Expand Down Expand Up @@ -161,14 +156,13 @@ let make = () => {
| Some({address}) =>
<div className={Css.merge([CssHelper.flexBox(~justify=`flexEnd, ()), Styles.container])}>
<div
id="userInfoButton"
className={Css.merge([CssHelper.flexBox(), CssHelper.clickable])}
onClick={_ => setShow(prev => !prev)}>
<div className=Styles.oval> <Icon name="fal fa-user" color=Colors.white /> </div>
<HSpacing size=Spacing.sm />
<Icon name="fas fa-caret-down" color=Colors.bandBlue />
</div>
<div className={Styles.profileCard(show)} id="addressWrapper">
<div className={Styles.profileCard(show)}>
<AddressRender address position=AddressRender.Text />
<VSpacing size={`px(16)} />
<div className=Styles.innerProfileCard>
Expand Down
3 changes: 1 addition & 2 deletions scan/src/components/modal/connect/ConnectWithMnemonic.re
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ let make = (~chainID) => {
<Text value="Enter Your Mnemonic" size=Text.Md weight=Text.Medium />
<VSpacing size=Spacing.sm />
<input
id="mnemonicInput"
autoFocus=true
value=mnemonic
className=Styles.inputBar
Expand All @@ -106,7 +105,7 @@ let make = (~chainID) => {
}
/>
<VSpacing size={`px(35)} />
<div id="mnemonicConnectButton" className={CssHelper.flexBox(~justify=`flexEnd, ())}>
<div className={CssHelper.flexBox(~justify=`flexEnd, ())}>
<Button px=20 py=8 onClick={_ => createMnemonic()}>
<Text value="Connect" weight=Text.Bold size=Text.Md color=Colors.white />
</Button>
Expand Down
1 change: 0 additions & 1 deletion scan/src/components/modal/submitTx/DelegateMsg.re
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ let make = (~address, ~validator, ~setMsgsOpt) => {
inputType="number"
code=true
autoFocus=true
id="delegateAmountInput"
/>;
| _ => <EnhanceTxInput.Loading msg="Delegate Amount (BAND)" width=300 />
}}
Expand Down
3 changes: 1 addition & 2 deletions scan/src/components/modal/submitTx/PreviewJsonStep.re
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ let make = (~rawTx, ~onBack, ~account: AccountContext.t) => {
</div>
<div
className=Styles.btn
id="broadcastButton"
onClick={_ => {
dispatchModal(DisableExit);
setState(_ => Signing);
Expand Down Expand Up @@ -193,7 +192,7 @@ let make = (~rawTx, ~onBack, ~account: AccountContext.t) => {
</div>
| Success(txHash) =>
<div className=Styles.resultContainer>
<div className=Styles.rFlex id="successMsgContainer">
<div className=Styles.rFlex>
<img src=Images.success2 className=Styles.resultIcon />
<HSpacing size=Spacing.md />
<Text value="Broadcast Transaction Success" weight=Text.Semibold />
Expand Down
1 change: 0 additions & 1 deletion scan/src/components/modal/submitTx/RedelegateMsg.re
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ let make = (~address, ~validator, ~setMsgsOpt) => {
inputType="number"
code=true
autoFocus=true
id="redelegateAmountInput"
/>;
| _ => <EnhanceTxInput.Loading msg="Amount (BAND)" width=300 />
}}
Expand Down
2 changes: 0 additions & 2 deletions scan/src/components/modal/submitTx/SendMsg.re
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ let make = (~address, ~receiver, ~setMsgsOpt) => {
parse=Parse.address
msg="Recipient Address"
code=true
id="recipientAddressInput"
placeholder="Insert recipient address"
autoFocus={
switch (toAddress.text) {
Expand Down Expand Up @@ -100,7 +99,6 @@ let make = (~address, ~receiver, ~setMsgsOpt) => {
| _ => true
}
}
id="sendAmountInput"
/>;
| _ => <EnhanceTxInput.Loading msg="Send Amount (BAND)" width=300 />
}}
Expand Down
2 changes: 0 additions & 2 deletions scan/src/components/modal/submitTx/SubmitTxModal.re
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ module SubmitTxStep = {
msg="Memo (optional)"
placeholder="Insert memo"
code=true
id="memoInput"
/>
<VSpacing size=Spacing.lg />
<VSpacing size=Spacing.md />
Expand All @@ -147,7 +146,6 @@ module SubmitTxStep = {
<VSpacing size=Spacing.lg />
<VSpacing size=Spacing.md />
<button
id="nextButton"
className=Styles.nextBtn
disabled={msgsOpt->Belt.Option.isNone}
onClick={_ => {
Expand Down
1 change: 0 additions & 1 deletion scan/src/components/modal/submitTx/UndelegateMsg.re
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ let make = (~address, ~validator, ~setMsgsOpt) => {
inputType="number"
code=true
autoFocus=true
id="undelegateAmountInput"
/>;
| _ => <EnhanceTxInput.Loading msg="Undelegate Amount (BAND)" width=300 />
}}
Expand Down
Loading

0 comments on commit 94a08e7

Please sign in to comment.