1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Update Dropdown components tests to use JSX (#7527)

This commit is contained in:
Whymarrh Whitby 2019-11-23 14:44:18 -03:30 committed by GitHub
parent 49dfb5ec2c
commit 714935d36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
const React = require('react')
const assert = require('assert')
const h = require('react-hyperscript')
const sinon = require('sinon')
const path = require('path')
const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'app', 'dropdowns', 'index.js')).Dropdown
@ -39,23 +39,19 @@ describe('Dropdown components', function () {
onClick = sinon.spy()
store = createMockStore(mockState)
component = mountWithStore(h(
Dropdown,
dropdownComponentProps,
[
h('style', `
.drop-menu-item:hover { background:rgb(235, 235, 235); }
.drop-menu-item i { margin: 11px; }
`),
h('li', {
closeMenu,
onClick,
}, 'Item 1'),
h('li', {
closeMenu,
onClick,
}, 'Item 2'),
]
component = mountWithStore((
<Dropdown {...dropdownComponentProps}>
<style>
{
`
.drop-menu-item:hover { background:rgb(235, 235, 235); }
.drop-menu-item i { margin: 11px; }
`
}
</style>
<li closeMenu={closeMenu} onClick={onClick}>Item 1</li>
<li closeMenu={closeMenu} onClick={onClick}>Item 2</li>
</Dropdown>
), store)
dropdownComponent = component
})