Skip to content

Commit

Permalink
test(e2e): add tests for fee and valid rounds on sign-transaction page
Browse files Browse the repository at this point in the history
  • Loading branch information
No-Cash-7970 committed Oct 10, 2024
1 parent 3d29736 commit 56b6f4c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/e2e/flow_single_txn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test.skip('Flow — Single transaction', async ({ homePage, page }) => {
.fill('3F3FPW6ZQQYD6JDC7FKKQHNGVVUIBIZOUI5WPSJEHBRABZDRN6LOTBMFEY');
await page.getByLabel('Amount*').click();
await page.getByLabel('Amount*').fill('0');
// Submit form to got to sign-transaction page
// Submit form to go to sign-transaction page
await page.getByRole('button', { name: 'Review & sign' }).click();

/*===== Sign Transaction page =====*/
Expand Down Expand Up @@ -99,6 +99,12 @@ async function checkSignTxnDataTable(page: Page) {
await expect(page.getByRole('row', { name: 'Note' }).getByRole('cell')).toHaveText('None');
await expect(page.getByRole('row', { name: 'Fee(Automatic)' }).getByRole('cell'))
.toHaveText('0.001 Algos');
await expect(
page.getByRole('row', { name: 'Transaction’s first valid round(Automatic)' }).getByRole('cell')
).toHaveText('44,440,857');
await expect(
page.getByRole('row', { name: 'Transaction’s last valid round(Automatic)' }).getByRole('cell')
).toHaveText('44,441,857');
await expect(page.getByRole('row', { name: 'Lease' }).getByRole('cell')).toHaveText('None');
await expect(page.getByRole('row', { name: 'Rekey to' }).getByRole('cell')).toHaveText('None');
}
23 changes: 23 additions & 0 deletions src/e2e/sign_txn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ test.describe('Sign Transaction Page', () => {
await expect(page.getByRole('contentinfo')).toBeVisible();
});

test('shows manual transaction fee and valid rounds', async ({ signTxnPage, page }) => {
// Compose a transaction and manually set fee and valid rounds
(new ComposeTxnPage(page)).goto('en',
'?preset=transfer'
+ '&snd=OMFLGYWNFKRIZ6Y6STE5SW3WJJQHLIG6GY4DD3FJHQRAK6MY5YMVJ6FWTY'
+ '&rcv=OMFLGYWNFKRIZ6Y6STE5SW3WJJQHLIG6GY4DD3FJHQRAK6MY5YMVJ6FWTY'
+ '&amt=0'
+ '&fv=41922740&lv=41922840&fee=.004'
);
// Submit form to go to sign-transaction page
await page.getByRole('button', { name: 'Review & sign' }).click();

// Check the fee and valid rounds
await expect(page.getByRole('row', { name: 'Fee(Manual)' }).getByRole('cell'))
.toHaveText('0.004 Algos');
await expect(
page.getByRole('row', { name: 'Transaction’s first valid round(Manual)' }).getByRole('cell')
).toHaveText('41,922,740');
await expect(
page.getByRole('row', { name: 'Transaction’s last valid round(Manual)' }).getByRole('cell')
).toHaveText('41,922,840');
});

test.describe('Language Support', () => {
(new LanguageSupport({
en: { body: /Sign/, title: /Sign/ },
Expand Down

0 comments on commit 56b6f4c

Please sign in to comment.