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