mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
[web] Minor fix and Coverage ++
This commit is contained in:
parent
d2fa4d8341
commit
9ff29cdb2b
@ -11,6 +11,7 @@ describe('ContentView Component', () => {
|
||||
let store = TStore()
|
||||
|
||||
it('should render correctly', () => {
|
||||
store.getState().ui.flow.contentView = 'Edit'
|
||||
let tflow = TFlow(),
|
||||
provider = renderer.create(
|
||||
<Provider store={store}>
|
||||
|
@ -3,7 +3,7 @@ jest.mock('../../components/EventLog/EventList')
|
||||
import React from 'react'
|
||||
import renderer from 'react-test-renderer'
|
||||
import TestUtils from 'react-dom/test-utils'
|
||||
import ConnectedComponent, { EventLog } from '../../components/EventLog'
|
||||
import EventLog, { PureEventLog } from '../../components/EventLog'
|
||||
import { Provider } from 'react-redux'
|
||||
import { TStore } from '../ducks/tutils'
|
||||
|
||||
@ -14,7 +14,7 @@ describe('EventLog Component', () => {
|
||||
let store = TStore(),
|
||||
provider = renderer.create(
|
||||
<Provider store={store}>
|
||||
<ConnectedComponent/>
|
||||
<EventLog/>
|
||||
</Provider>),
|
||||
tree = provider.toJSON()
|
||||
|
||||
@ -22,14 +22,14 @@ describe('EventLog Component', () => {
|
||||
expect(tree).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('should handl toggleFilter', () => {
|
||||
it('should handle toggleFilter', () => {
|
||||
let debugToggleButton = tree.children[0].children[1].children[0]
|
||||
debugToggleButton.props.onClick()
|
||||
})
|
||||
|
||||
provider = TestUtils.renderIntoDocument(
|
||||
<Provider store={store}><ConnectedComponent/></Provider>)
|
||||
let eventLog = TestUtils.findRenderedComponentWithType(provider, EventLog),
|
||||
<Provider store={store}><EventLog/></Provider>)
|
||||
let eventLog = TestUtils.findRenderedComponentWithType(provider, PureEventLog),
|
||||
mockEvent = { preventDefault: jest.fn() }
|
||||
|
||||
it('should handle DragStart', () => {
|
||||
|
@ -5,7 +5,7 @@ import { toggleFilter, toggleVisibility } from '../ducks/eventLog'
|
||||
import ToggleButton from './common/ToggleButton'
|
||||
import EventList from './EventLog/EventList'
|
||||
|
||||
export class EventLog extends Component {
|
||||
export class PureEventLog extends Component {
|
||||
|
||||
static propTypes = {
|
||||
filters: PropTypes.object.isRequired,
|
||||
@ -77,4 +77,4 @@ export default connect(
|
||||
close: toggleVisibility,
|
||||
toggleFilter: toggleFilter,
|
||||
}
|
||||
)(EventLog)
|
||||
)(PureEventLog)
|
||||
|
Loading…
Reference in New Issue
Block a user