generated from multiversx/mx-template-dapp
-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
00a35aa
commit 75c25ee
Showing
19 changed files
with
459 additions
and
71 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
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 |
---|---|---|
|
@@ -18,15 +18,15 @@ | |
"build": "tsc && npm run set-storage-persist && vite build", | ||
"build:devnet": "npm run copy:devnet-config && npm run build", | ||
"build:sovereign": "npm run copy:sovereign-config && npm run build", | ||
"build:devnet-msw": "npm run copy:devnet-config & VITE_APP_MSW=true npm run build", | ||
"build:sovereign-msw": "npm run copy:sovereign-config & VITE_APP_MSW=true npm run build", | ||
"build:testnet": "npm run copy:testnet-config & npm run build", | ||
"build:mainnet": "npm run copy:mainnet-config & npm run build", | ||
"postbuild": "node src/scripts/createVersionFile/index", | ||
"copy:devnet-config": "cp ./src/config/config.devnet.ts ./src/config/index.ts", | ||
"copy:testnet-config": "cp ./src/config/config.testnet.ts ./src/config/index.ts", | ||
"copy:mainnet-config": "cp ./src/config/config.mainnet.ts ./src/config/index.ts", | ||
"copy:sovereign-config": "cp ./src/config/config.sovereign.ts ./src/config/index.ts", | ||
"test:pptr-headless": "npx @puppeteer/browsers install [email protected] && jest --config=jest-puppeteer.config.js", | ||
"test:pptr-headless": "HEADLESS=true jest --config=jest-puppeteer.config.js", | ||
"test:pptr": "JEST_PPTR_RETRY_TIMES=0 HEADLESS=false jest --config=jest-puppeteer.config.js", | ||
"test": "jest", | ||
"preview": "vite preview" | ||
|
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,16 +1,17 @@ | ||
export const dappConfig = { | ||
id: 'devnet', | ||
name: 'Devnet', | ||
egldLabel: 'xEGLD', | ||
id: 'sovereign', | ||
name: 'Sovereign', | ||
egldLabel: 'WEGLD', | ||
decimals: '4', | ||
egldDenomination: '18', | ||
gasPerDataByte: '1500', | ||
apiTimeout: '4000', | ||
walletConnectDeepLink: | ||
'https://maiar.page.link/?apn=com.multiversx.maiar.wallet&isi=1519405832&ibi=com.multiversx.maiar.wallet&link=https://maiar.com/', | ||
walletConnectBridgeAddresses: ['https://bridge.walletconnect.org'], | ||
walletAddress: 'https://devnet-wallet.multiversx.com', | ||
apiAddress: 'https://devnet-api.multiversx.com', | ||
explorerAddress: 'http://devnet-explorer.multiversx.com', | ||
chainId: 'D' | ||
walletAddress: 'https://wallet-sovereign-test.elrond.ro/', | ||
apiAddress: 'https://api-sovereign-test.elrond.ro', | ||
explorerAddress: | ||
'https://api-sovereign-test.internal-explorer.multiversx.com', | ||
chainId: 'local-testnet' | ||
}; |
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,5 @@ | ||
export const faucetSettings = { | ||
address: 'erd1xgzak3d6wcpyk83c3ne0n05khdz026e8p0rg8qu65dly706kfmxs0qecax', | ||
amount: '40000000000000000000', | ||
recaptchaBypass: true | ||
}; |
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,7 +1,9 @@ | ||
export * from './constants'; | ||
export * from './dappConfig'; | ||
export * from './emptyWallet'; | ||
export * from './faucetSettings'; | ||
export * from './networkConfig'; | ||
export * from './testKeystoreWallet'; | ||
export * from './testNetwork'; | ||
export * from './testPemWallet'; | ||
export * from './testPemWalletGuarded'; |
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,4 @@ | ||
export const testNetwork = { | ||
apiAddress: 'https://devnet-api.multiversx.com' | ||
apiAddress: 'https://api-sovereign-test.elrond.ro', | ||
extrasApiAddress: 'https://extras-api-sovereign-test.elrond.ro' | ||
}; |
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,5 @@ | ||
-----BEGIN PRIVATE KEY for erd1dc3yzxxeq69wvf583gw0h67td226gu2ahpk3k50qdgzzym8npltq7ndgha----- | ||
YjMzODcyMjMzMjFjNTg3YzM1MTE5OGFkYzI1MzFjODIwYTM3OGQzNzQ4OTU2YjNk | ||
YWUyZTBmNWExZGFhN2NhMTZlMjI0MTE4ZDkwNjhhZTYyNjg3OGExY2ZiZWJjYjZh | ||
OTVhNDcxNWRiODZkMWI1MWUwNmEwNDIyNmNmMzBmZDY= | ||
-----END PRIVATE KEY for erd1dc3yzxxeq69wvf583gw0h67td226gu2ahpk3k50qdgzzym8npltq7ndgha----- |
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 @@ | ||
export * from './pemAccountGuarded'; |
18 changes: 18 additions & 0 deletions
18
src/__mocks__/data/testPemWalletGuarded/pemAccountGuarded.ts
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,18 @@ | ||
import { emptyWalletAccount } from '../emptyWallet'; | ||
|
||
export const pemAccountGuarded = { | ||
address: 'erd1dc3yzxxeq69wvf583gw0h67td226gu2ahpk3k50qdgzzym8npltq7ndgha', | ||
balance: '4559443050404540691', | ||
nonce: 71, | ||
timestamp: 1685712294, | ||
shard: 1, | ||
rootHash: 'cB9GBtevo98yZf906jxVI++W6U68+V+22NnUJEpOs8c=', | ||
txCount: 74, | ||
scrCount: 64, | ||
developerReward: '0', | ||
activeGuardianActivationEpoch: 1119, | ||
activeGuardianAddress: emptyWalletAccount.address, | ||
activeGuardianServiceUid: 'MultiversXTCSService', | ||
pendingGuardianAddress: undefined, | ||
isGuarded: true | ||
}; |
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
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,34 @@ | ||
import { DEFAULT_DELAY_MS, WALLET_SOURCE_ORIGIN } from '__mocks__/data'; | ||
import { | ||
expectElementToContainText, | ||
getByDataTestId, | ||
loginWithPem, | ||
sleep | ||
} from 'utils/testUtils/puppeteer'; | ||
import { DataTestIdsEnum } from 'localConstants/dataTestIds.enum'; | ||
|
||
describe('Request funds tests', () => { | ||
it('should receive 40 WEGLD successfully', async () => { | ||
await page.goto(`${WALLET_SOURCE_ORIGIN}/logout`, { | ||
waitUntil: 'domcontentloaded' | ||
}); | ||
|
||
await loginWithPem(); | ||
const requestFundsButton = await page.waitForSelector( | ||
getByDataTestId(DataTestIdsEnum.faucetBtn) | ||
); | ||
|
||
await requestFundsButton.click(); | ||
await expectElementToContainText({ | ||
dataTestId: DataTestIdsEnum.modalSubtitle, | ||
text: 'You can request 40 WEGLD every 24 hours' | ||
}); | ||
|
||
await page.click(getByDataTestId(DataTestIdsEnum.requestFundsButton)); | ||
await sleep(DEFAULT_DELAY_MS); | ||
await expectElementToContainText({ | ||
dataTestId: DataTestIdsEnum.modalSubtitle, | ||
text: '40 WEGLD have been sent to your address.' | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.