Skip to content

Commit

Permalink
WIP notes
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed Mar 7, 2024
1 parent 13897da commit 9e7a2f7
Showing 1 changed file with 75 additions and 75 deletions.
150 changes: 75 additions & 75 deletions tests/specs/send/send-btc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,80 +31,80 @@ test.describe('send btc', () => {
const details = await sendPage.confirmationDetails.allInnerTexts();
test.expect(details).toBeTruthy();
});
// test('that recipient input is trimmed correctly', async ({ sendPage }) => {
// await sendPage.amountInput.fill('0.00006');
// await sendPage.recipientInput.fill(' ' + TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS + ' ');
// await sendPage.recipientInput.blur();
// await sendPage.page.waitForTimeout(1000);
// await sendPage.previewSendTxButton.click();
// await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

// const displayerAddress = await getDisplayerAddress(sendPage.confirmationDetailsRecipient);
// test.expect(displayerAddress).toEqual(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);
// });
// // broke
// test('that asset value and recipient on preview match input', async ({ sendPage }) => {
// const amount = '0.00006';
// const amountSymbol = 'BTC';

// await sendPage.amountInput.fill(amount);
// await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);
// await sendPage.recipientInput.blur();
// await sendPage.page.waitForTimeout(1000);

// await sendPage.previewSendTxButton.click();
// await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

// const displayerAddress = await getDisplayerAddress(sendPage.confirmationDetailsRecipient);
// test.expect(displayerAddress).toEqual(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

// const confirmationAssetValue = await sendPage.confirmationDetails
// .getByTestId(SharedComponentsSelectors.InfoCardAssetValue)
// .innerText();
// test.expect(confirmationAssetValue).toEqual(`${amount} ${amountSymbol}`);
// });

// test('that fee value on preview match chosen one', async ({ sendPage }) => {
// await sendPage.amountInput.fill('0.00006');
// await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

// await sendPage.previewSendTxButton.click();

// const feeType = BtcFeeType.Standard;
// const fee = await sendPage.feesListItem
// .filter({ hasText: feeType })
// .getByTestId(SharedComponentsSelectors.FeesListItemFeeValue)
// .innerText();

// await sendPage.feesListItem.filter({ hasText: feeType }).click();

// const confirmationFee = await sendPage.confirmationDetails
// .getByTestId(SendCryptoAssetSelectors.ConfirmationDetailsFee)
// .getByTestId(SharedComponentsSelectors.InfoCardRowValue)
// .innerText();

// test.expect(fee).toContain(confirmationFee);
// });

// test('that prevents transaction if it contains inscribed utxo', async ({ sendPage }) => {
// await sendPage.page.route('**/ordinals-explorer.generative.xyz/**', async route => {
// return route.fulfill({
// status: 200,
// contentType: 'text/html',
// body: mockOrdinalsComApiHtmlResponse,
// });
// });
// await sendPage.amountInput.fill('0.00006');
// await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

// await sendPage.previewSendTxButton.click();
// await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

// await sendPage.clickInfoCardButton();

// const isErrorPageVisible = await sendPage.broadcastErrorTitle.isVisible();

// test.expect(isErrorPageVisible).toBeTruthy();
// });
test('that recipient input is trimmed correctly', async ({ sendPage }) => {
await sendPage.amountInput.fill('0.00006');
await sendPage.recipientInput.fill(' ' + TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS + ' ');
await sendPage.recipientInput.blur();
await sendPage.page.waitForTimeout(1000);
await sendPage.previewSendTxButton.click();
await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

const displayerAddress = await getDisplayerAddress(sendPage.confirmationDetailsRecipient);
test.expect(displayerAddress).toEqual(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);
});
// broke
test('that asset value and recipient on preview match input', async ({ sendPage }) => {
const amount = '0.00006';
const amountSymbol = 'BTC';

await sendPage.amountInput.fill(amount);
await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);
await sendPage.recipientInput.blur();
await sendPage.page.waitForTimeout(1000);

await sendPage.previewSendTxButton.click();
await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

const displayerAddress = await getDisplayerAddress(sendPage.confirmationDetailsRecipient);
test.expect(displayerAddress).toEqual(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

const confirmationAssetValue = await sendPage.confirmationDetails
.getByTestId(SharedComponentsSelectors.InfoCardAssetValue)
.innerText();
test.expect(confirmationAssetValue).toEqual(`${amount} ${amountSymbol}`);
});

test('that fee value on preview match chosen one', async ({ sendPage }) => {
await sendPage.amountInput.fill('0.00006');
await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

await sendPage.previewSendTxButton.click();

const feeType = BtcFeeType.Standard;
const fee = await sendPage.feesListItem
.filter({ hasText: feeType })
.getByTestId(SharedComponentsSelectors.FeesListItemFeeValue)
.innerText();

await sendPage.feesListItem.filter({ hasText: feeType }).click();

const confirmationFee = await sendPage.confirmationDetails
.getByTestId(SendCryptoAssetSelectors.ConfirmationDetailsFee)
.getByTestId(SharedComponentsSelectors.InfoCardRowValue)
.innerText();

test.expect(fee).toContain(confirmationFee);
});

test('that prevents transaction if it contains inscribed utxo', async ({ sendPage }) => {
await sendPage.page.route('**/ordinals-explorer.generative.xyz/**', async route => {
return route.fulfill({
status: 200,
contentType: 'text/html',
body: mockOrdinalsComApiHtmlResponse,
});
});
await sendPage.amountInput.fill('0.00006');
await sendPage.recipientInput.fill(TEST_TESTNET_ACCOUNT_2_BTC_ADDRESS);

await sendPage.previewSendTxButton.click();
await sendPage.feesListItem.filter({ hasText: BtcFeeType.High }).click();

await sendPage.clickInfoCardButton();

const isErrorPageVisible = await sendPage.broadcastErrorTitle.isVisible();

test.expect(isErrorPageVisible).toBeTruthy();
});
});
});

0 comments on commit 9e7a2f7

Please sign in to comment.