Skip to content

Commit

Permalink
fixed issues with truncated keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ost-ptk committed Nov 16, 2023
1 parent 41cb69c commit 73df1c6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
16 changes: 13 additions & 3 deletions e2e-tests/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,29 @@ export const IMPORTED_ACCOUNT = {
accountName: ACCOUNT_NAMES.importedAccountName,
publicKey:
'0184f6d260f4ee6869ddb36affe15456de6ae045278fa2f467bb677561ce0dad55',
truncatedPublicKey: '0184f...dad55'
truncatedPublicKey: '0184...ad55'
};

export const DEFAULT_FIRST_ACCOUNT = {
accountName: ACCOUNT_NAMES.defaultFirstAccountName,
publicKey:
'0202b1943511b8c23b1b2b8ed7ddcedffcc7be70d9366a5005c7beab08a81b7ae633',
truncatedPublicKey: '0202b...ae633'
truncatedPublicKey: '0202...e633'
};

export const DEFAULT_SECOND_ACCOUNT = {
accountName: ACCOUNT_NAMES.defaultSecondAccountName,
publicKey:
'0203b2e05f074452f5e69ba512310deceaca152ebd3394eadcec26c6e68e91aa7724',
truncatedPublicKey: '0203b...a7724'
truncatedPublicKey: '0203...7724'
};

export const VALIDATOR = {
name: 'Validator',
truncatedPublicKey: '0106...a2ca'
};

export const NEW_VALIDATOR = {
name: 'New validator',
truncatedPublicKey: '017d...009e'
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { popup, popupExpect } from '../../fixtures';
import { DEFAULT_FIRST_ACCOUNT, PLAYGROUND_URL } from '../../constants';
import {
DEFAULT_FIRST_ACCOUNT,
NEW_VALIDATOR,
PLAYGROUND_URL,
VALIDATOR
} from '../../constants';

popup.describe('Popup UI: signature request scenarios', () => {
popup.beforeEach(async ({ connectAccounts, page }) => {
Expand Down Expand Up @@ -30,7 +35,7 @@ popup.describe('Popup UI: signature request scenarios', () => {
signatureRequestPage.getByText('Recipient (Key)')
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('0106c...ca2ca')
signatureRequestPage.getByText(VALIDATOR.truncatedPublicKey)
).toBeVisible();
await popupExpect(signatureRequestPage.getByText('Amount')).toBeVisible();
await popupExpect(signatureRequestPage.getByText('2.5 CSPR')).toBeVisible();
Expand Down Expand Up @@ -76,10 +81,10 @@ popup.describe('Popup UI: signature request scenarios', () => {
.nth(2)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('Validator')
signatureRequestPage.getByText(VALIDATOR.name)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('0106c...ca2ca')
signatureRequestPage.getByText(VALIDATOR.truncatedPublicKey)
).toBeVisible();
await popupExpect(signatureRequestPage.getByText('Amount')).toBeVisible();
await popupExpect(
Expand Down Expand Up @@ -125,10 +130,10 @@ popup.describe('Popup UI: signature request scenarios', () => {
.nth(2)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('Validator')
signatureRequestPage.getByText(VALIDATOR.name)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('0106c...ca2ca')
signatureRequestPage.getByText(VALIDATOR.truncatedPublicKey)
).toBeVisible();
await popupExpect(signatureRequestPage.getByText('Amount')).toBeVisible();
await popupExpect(signatureRequestPage.getByText('2.5 CSPR')).toBeVisible();
Expand Down Expand Up @@ -172,18 +177,18 @@ popup.describe('Popup UI: signature request scenarios', () => {
.nth(2)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('Validator', { exact: true })
signatureRequestPage.getByText(VALIDATOR.name, { exact: true })
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('0106c...ca2ca')
signatureRequestPage.getByText(VALIDATOR.truncatedPublicKey)
).toBeVisible();
await popupExpect(signatureRequestPage.getByText('Amount')).toBeVisible();
await popupExpect(signatureRequestPage.getByText('2.5 CSPR')).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('New validator')
signatureRequestPage.getByText(NEW_VALIDATOR.name)
).toBeVisible();
await popupExpect(
signatureRequestPage.getByText('017d9...2009e')
signatureRequestPage.getByText(NEW_VALIDATOR.truncatedPublicKey)
).toBeVisible();

page.on('dialog', async dialog => {
Expand Down

0 comments on commit 73df1c6

Please sign in to comment.