1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Set view full transaction details by default (#15726)

This commit is contained in:
VSaric 2022-09-06 15:36:02 +02:00 committed by GitHub
parent 3154e5e19c
commit 0b92b13def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 8 deletions

View File

@ -552,6 +552,10 @@ describe('MetaMask', function () {
}); });
it('displays the token approval data', async function () { it('displays the token approval data', async function () {
await driver.clickElement({
text: 'View full transaction details',
css: '.confirm-approve-content__small-blue-text',
});
const functionType = await driver.findElement( const functionType = await driver.findElement(
'.confirm-approve-content__data .confirm-approve-content__small-text', '.confirm-approve-content__data .confirm-approve-content__small-text',
); );
@ -738,6 +742,10 @@ describe('MetaMask', function () {
}); });
it('shows the correct recipient', async function () { it('shows the correct recipient', async function () {
await driver.clickElement({
text: 'View full transaction details',
css: '.confirm-approve-content__small-blue-text',
});
const permissionInfo = await driver.findElements( const permissionInfo = await driver.findElements(
'.confirm-approve-content__medium-text', '.confirm-approve-content__medium-text',
); );

View File

@ -108,6 +108,10 @@ describe('Collectibles', function () {
const title = await driver.findElement( const title = await driver.findElement(
'[data-testid="confirm-approve-title"]', '[data-testid="confirm-approve-title"]',
); );
await driver.clickElement({
text: 'View full transaction details',
css: '.confirm-approve-content__small-blue-text',
});
const data = await driver.findElements( const data = await driver.findElements(
'.confirm-approve-content__data .confirm-approve-content__small-text', '.confirm-approve-content__data .confirm-approve-content__small-text',
); );
@ -170,6 +174,10 @@ describe('Collectibles', function () {
const title = await driver.findElement( const title = await driver.findElement(
'[data-testid="confirm-approve-title"]', '[data-testid="confirm-approve-title"]',
); );
await driver.clickElement({
text: 'View full transaction details',
css: '.confirm-approve-content__small-blue-text',
});
const data = await driver.findElements( const data = await driver.findElements(
'.confirm-approve-content__data .confirm-approve-content__small-text', '.confirm-approve-content__data .confirm-approve-content__small-text',
); );

View File

@ -83,7 +83,7 @@ export default class ConfirmApproveContent extends Component {
}; };
state = { state = {
showFullTxDetails: true, showFullTxDetails: false,
copied: false, copied: false,
}; };

View File

@ -55,7 +55,7 @@ describe('ConfirmApproveContent Component', () => {
), ),
).toBeInTheDocument(); ).toBeInTheDocument();
expect(queryByText('0x9bc5...fef4')).toBeInTheDocument(); expect(queryByText('0x9bc5...fef4')).toBeInTheDocument();
expect(queryByText('Hide full transaction details')).toBeInTheDocument(); expect(queryByText('View full transaction details')).toBeInTheDocument();
expect(queryByText('Edit permission')).toBeInTheDocument(); expect(queryByText('Edit permission')).toBeInTheDocument();
const editPermission = getByText('Edit permission'); const editPermission = getByText('Edit permission');
@ -77,15 +77,15 @@ describe('ConfirmApproveContent Component', () => {
fireEvent.click(editButtons[1]); fireEvent.click(editButtons[1]);
expect(props.showCustomizeNonceModal).toHaveBeenCalledTimes(1); expect(props.showCustomizeNonceModal).toHaveBeenCalledTimes(1);
const showHideTxDetails = getByText('Hide full transaction details'); const showViewTxDetails = getByText('View full transaction details');
expect(getByText('Permission request')).toBeInTheDocument();
expect(getByText('Approved amount:')).toBeInTheDocument();
expect(getByText('Granted to:')).toBeInTheDocument();
fireEvent.click(showHideTxDetails);
expect(getByText('View full transaction details')).toBeInTheDocument();
expect(queryByText('Permission request')).not.toBeInTheDocument(); expect(queryByText('Permission request')).not.toBeInTheDocument();
expect(queryByText('Approved amount:')).not.toBeInTheDocument(); expect(queryByText('Approved amount:')).not.toBeInTheDocument();
expect(queryByText('Granted to:')).not.toBeInTheDocument(); expect(queryByText('Granted to:')).not.toBeInTheDocument();
fireEvent.click(showViewTxDetails);
expect(getByText('Hide full transaction details')).toBeInTheDocument();
expect(getByText('Permission request')).toBeInTheDocument();
expect(getByText('Approved amount:')).toBeInTheDocument();
expect(getByText('Granted to:')).toBeInTheDocument();
expect(getByText('0x9bc5...fef4')).toBeInTheDocument(); expect(getByText('0x9bc5...fef4')).toBeInTheDocument();
}); });
}); });