1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-25 12:52:33 +02:00
metamask-extension/ui/app/pages/settings/advanced-tab/tests/advanced-tab-component.test.js
Dan J Miller 32a3f5ad7b
Address various UI styling issues (#6744)
* Add loading spinner to pending tx status label.

* Add border around account icon in top right

* Change style of settings toggle buttons; wrap with local components

* Eliminate large space after settings labels when no description

* Remove network form from advanced tab of settings

* Keep new account container height to contents when in full screen
2019-07-08 15:28:35 -02:30

45 lines
1.1 KiB
JavaScript

import React from 'react'
import assert from 'assert'
import sinon from 'sinon'
import { shallow } from 'enzyme'
import AdvancedTab from '../advanced-tab.component'
import TextField from '../../../../components/ui/text-field'
describe('AdvancedTab Component', () => {
it('should render correctly', () => {
const root = shallow(
<AdvancedTab />,
{
context: {
t: s => `_${s}`,
},
}
)
assert.equal(root.find('.settings-page__content-row').length, 7)
})
it('should update autoLogoutTimeLimit', () => {
const setAutoLogoutTimeLimitSpy = sinon.spy()
const root = shallow(
<AdvancedTab
setAutoLogoutTimeLimit={setAutoLogoutTimeLimitSpy}
/>,
{
context: {
t: s => `_${s}`,
},
}
)
const autoTimeout = root.find('.settings-page__content-row').last()
const textField = autoTimeout.find(TextField)
textField.props().onChange({ target: { value: 1440 } })
assert.equal(root.state().autoLogoutTimeLimit, 1440)
autoTimeout.find('button').simulate('click')
assert.equal(setAutoLogoutTimeLimitSpy.args[0][0], 1440)
})
})