mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
[web] Update ContentLoader class name.
This commit is contained in:
parent
d1a40def20
commit
49a04e37c3
@ -1,12 +1,11 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import renderer from 'react-test-renderer'
|
import renderer from 'react-test-renderer'
|
||||||
import ContentLoaderGenerator from '../../../components/ContentView/ContentLoader'
|
import withContentLoader from '../../../components/ContentView/ContentLoader'
|
||||||
import { TFlow } from '../../ducks/tutils'
|
import { TFlow } from '../../ducks/tutils'
|
||||||
import TestUtils from 'react-dom/test-utils'
|
import TestUtils from 'react-dom/test-utils'
|
||||||
import mockXMLHttpRequest from 'mock-xmlhttprequest'
|
import mockXMLHttpRequest from 'mock-xmlhttprequest'
|
||||||
|
|
||||||
global.XMLHttpRequest = mockXMLHttpRequest
|
global.XMLHttpRequest = mockXMLHttpRequest
|
||||||
|
|
||||||
class tComponent extends React.Component {
|
class tComponent extends React.Component {
|
||||||
constructor(props, context){
|
constructor(props, context){
|
||||||
super(props, context)
|
super(props, context)
|
||||||
@ -17,7 +16,7 @@ class tComponent extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let tflow = new TFlow(),
|
let tflow = new TFlow(),
|
||||||
ContentLoader = ContentLoaderGenerator(tComponent)
|
ContentLoader = withContentLoader(tComponent)
|
||||||
|
|
||||||
describe('ContentLoader Component', () => {
|
describe('ContentLoader Component', () => {
|
||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
||||||
|
@ -2,8 +2,9 @@ import React, { Component } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { MessageUtils } from '../../flow/utils.js'
|
import { MessageUtils } from '../../flow/utils.js'
|
||||||
|
|
||||||
export default View => class extends React.Component {
|
export default function withContentLoader(View) {
|
||||||
|
|
||||||
|
return class extends React.Component {
|
||||||
static displayName = View.displayName || View.name
|
static displayName = View.displayName || View.name
|
||||||
static matches = View.matches
|
static matches = View.matches
|
||||||
|
|
||||||
@ -96,4 +97,5 @@ export default View => class extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user