mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 18:03:50 +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 renderer from 'react-test-renderer'
|
||||
import ContentLoaderGenerator from '../../../components/ContentView/ContentLoader'
|
||||
import withContentLoader from '../../../components/ContentView/ContentLoader'
|
||||
import { TFlow } from '../../ducks/tutils'
|
||||
import TestUtils from 'react-dom/test-utils'
|
||||
import mockXMLHttpRequest from 'mock-xmlhttprequest'
|
||||
|
||||
global.XMLHttpRequest = mockXMLHttpRequest
|
||||
|
||||
class tComponent extends React.Component {
|
||||
constructor(props, context){
|
||||
super(props, context)
|
||||
@ -17,7 +16,7 @@ class tComponent extends React.Component {
|
||||
}
|
||||
|
||||
let tflow = new TFlow(),
|
||||
ContentLoader = ContentLoaderGenerator(tComponent)
|
||||
ContentLoader = withContentLoader(tComponent)
|
||||
|
||||
describe('ContentLoader Component', () => {
|
||||
it('should render correctly', () => {
|
||||
|
@ -2,8 +2,9 @@ import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
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 matches = View.matches
|
||||
|
||||
@ -96,4 +97,5 @@ export default View => class extends React.Component {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user