1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-12 04:37:13 +01:00
metamask-extension/ui/pages/settings/settings.component.test.js
igorms-cons f5e86d0351
Feat/settings search (#13214)
* fix error with color variable - fix rebase

* clean list search & fuse threshold decreased

* update search-icon , fix tests

* nice to have highlighting text & cleaning

* unit test on settings & search input ui up on expanded view

* fix color variable in alert scss

* setting search input padding right up

* fix dom warning

* util/search test added & Dom element warning fix

* renaming files

* fix color text in settings search

* settings search highlight text refacto & fix ui

* fix settings-search test & renaming

* Fix styling on search field for edge cases, update components and e2e

E2E tests update for search feature

Update components from class to functional component

		#

Fix storybook for search box

Fix styling

Fix unit tests

fix: remove z-index

Fix unit tests

Co-authored-by: amerkadicE <amer.kadic@endava.com>
2022-02-22 17:28:21 -03:30

53 lines
1.3 KiB
JavaScript

import React from 'react';
import { shallow } from 'enzyme';
import TextField from '../../components/ui/text-field';
import Settings from './settings.container';
import SettingsSearch from './settings-search';
describe('SettingsPage', () => {
let wrapper;
const props = {
isAddressEntryPage: false,
backRoute: '/',
currentPath: '/settings',
location: '/settings',
mostRecentOverviewPage: '',
isPopup: false,
pathnameI18nKey: undefined,
addressName: '',
initialBreadCrumbRoute: undefined,
initialBreadCrumbKey: undefined,
addNewNetwork: false,
conversionDate: Date.now(),
};
beforeEach(() => {
wrapper = shallow(<Settings.WrappedComponent {...props} />, {
context: {
t: (str) => str,
},
});
});
it('should render title correctly', () => {
expect(
wrapper.find('.settings-page__header__title-container__title').text(),
).toStrictEqual('settings');
});
it('should render search correctly', () => {
wrapper = shallow(
<SettingsSearch onSearch={() => undefined} settingsRoutesList={[]} />,
{
context: {
t: (s) => `${s}`,
},
},
);
expect(wrapper.find(TextField).props().id).toStrictEqual('search-settings');
expect(wrapper.find(TextField).props().value).toStrictEqual('');
});
});