1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/test/e2e/tests/settings-general.spec.js
Thomas Huang 119219b5d2
Continue converting tests from enzyme to @testing-library/react (#16458)
* Add transaction activity log component

* Remove duplicate tx activity log snapshot.

* Convert Advanced Tab to tlr.

* Lint fix

* Convert Settings Tab test to tlr.

* Convert Send Amount Row test to tlr.

* Convert Send Row Error Message test to tlr.

* Add Mock Send State json file.

* Lint fix

* Use proper testid for jazz icon for settings e2e

* Update Send Amount Row snapshot
2022-11-29 07:42:59 -08:00

60 lines
1.7 KiB
JavaScript

const { strict: assert } = require('assert');
const { convertToHexValue, withFixtures } = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
describe('Settings', function () {
const ganacheOptions = {
accounts: [
{
secretKey:
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
balance: convertToHexValue(25000000000000000000),
},
],
};
it('checks jazzicon and blockies icons', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
ganacheOptions,
title: this.test.title,
},
async ({ driver }) => {
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
// goes to the settings screen
await driver.clickElement('.account-menu__icon');
await driver.clickElement({ text: 'Settings', tag: 'div' });
// finds the jazzicon toggle turned on
await driver.findElement(
'[data-testid="jazz_icon"] .settings-page__content-item__identicon__item__icon--active',
);
const jazziconText = await driver.findElement({
tag: 'h6',
text: 'Jazzicons',
});
assert.equal(
await jazziconText.getText(),
'Jazzicons',
'Text for icon should be Jazzicons',
);
const blockiesText = await driver.findElement({
tag: 'h6',
text: 'Blockies',
});
assert.equal(
await blockiesText.getText(),
'Blockies',
'Text for icon should be Blockies',
);
},
);
});
});