Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/Sonic test network tokens mint #683

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"from-exponential": "^1.1.1",
"i18next": "^20.2.1",
"moment": "^2.29.1",
"node-fetch": "^2.6.1",
"puppeteer": "^13.6.0",
"qrcode": "^1.4.4",
"query-string": "^7.0.0",
Expand Down
24 changes: 24 additions & 0 deletions tests/e2e/send-tokens.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fetch = require('node-fetch');
const { formatTokenAmount } = require('../utils/string');

const AMOUNT_TO_SEND = 0.0001;
Expand Down Expand Up @@ -215,6 +216,27 @@ async function fillSendingInfoAndSend(page, name, recipient, previousAmounts) {
await sendViewButtonClick(page);
}

async function addSonicUser() {

try {
const body = {
principal: secrets.mainPrincipalId,
}

const res = await fetch('https://testnet.sonic.ooo/service-http/add-user', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});

if (res.ok) {
console.log('💻 Successfully created added the principal ID to the Sonic testnet.')
}
} catch (error) {
console.error(error);
}
}

describe('Send View', () => {
let browser;
let page;
Expand All @@ -223,6 +245,8 @@ describe('Send View', () => {
beforeAll(async () => {
browser = await setupChrome();

await addSonicUser();

// Importing and unlocking the account
page = await utils.createNewPage(browser);

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9183,7 +9183,7 @@ node-addon-api@^2.0.0:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==

[email protected]:
[email protected], node-fetch@^2.6.1:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
Expand Down