You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.5 KiB
61 lines
1.5 KiB
import React from 'react';
|
|
import { mount, shallow } from 'enzyme';
|
|
import { Provider } from 'react-redux';
|
|
import TextField from '../../components/ui/text-field';
|
|
import configureStore from '../../store/store';
|
|
import Settings from './settings.container';
|
|
import SettingsSearch from './settings-search';
|
|
|
|
describe('SettingsPage', () => {
|
|
let wrapper;
|
|
|
|
const props = {
|
|
addNewNetwork: false,
|
|
addressName: '',
|
|
backRoute: '/',
|
|
conversionDate: Date.now(),
|
|
currentPath: '/settings',
|
|
initialBreadCrumbKey: undefined,
|
|
initialBreadCrumbRoute: undefined,
|
|
isAddressEntryPage: false,
|
|
isPopup: false,
|
|
location: '/settings',
|
|
mostRecentOverviewPage: '',
|
|
pathnameI18nKey: undefined,
|
|
};
|
|
|
|
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', () => {
|
|
const store = configureStore({
|
|
metamask: {
|
|
snaps: {},
|
|
},
|
|
});
|
|
wrapper = mount(
|
|
<Provider store={store}>
|
|
<SettingsSearch onSearch={() => undefined} settingsRoutesList={[]} />
|
|
</Provider>,
|
|
{
|
|
context: {
|
|
t: (s) => `${s}`,
|
|
},
|
|
},
|
|
);
|
|
|
|
expect(wrapper.find(TextField).props().id).toStrictEqual('search-settings');
|
|
expect(wrapper.find(TextField).props().value).toStrictEqual('');
|
|
});
|
|
});
|
|
|