jsx文件的mocha测试用例
您好,
所以不确定如何从sports-template-standard.jsx传递Bottom对象
在下面提供我的测试用例
import {expect} from 'chai';
import Bottom from '../../src/components/bottom/bottom';
//import {
// addFootnoteAction,
// removeFootnoteAction
//} from '../../src/redux/footnotes/footnotes-actions';
let footnote1 = {
disclosures: [],
footnotes: [],
layout: 'sfsdfs'
};
describe('Bottom testing', function() {
it('should contain one footnote when added', function() {
let footnote1 = {
disclosures: [],
footnotes: [],
layout: 'sfsdfs'
};
//错误意外令牌在下面一行 }); });
bottom.jsx 从'react'导入React; 从'react-redux'导入{connect}; 从'../link-pack'导入LinkPack; 从'./disclosure-list'导入DisclosureList; 从'./footnote-list'导入FootnoteList; //调试; let Bottom = React.createClass({ propTypes:{ 披露:React.PropTypes.array, 脚注:React.PropTypes.array, layout:React.PropTypes.object },
render() {
let linkPack,
ehl,
legal;
//Remove once reducer is implemented
let bottom = {
ehl: true,
legal: '132090-0611'
};
if (this.props.layout.headerPanel !== 'mobile') {
linkPack = <LinkPack />;
}
ehl = <img className="sportsPageBottom-housing" src="~^ img, housing.svg ~^" />;
legal = bottom.legal;
return (
{} linkPack
版权所有©2016体育•切换到移动•关于我们的广告
{/ * Equal Housing Lender logo(在WCM披露中) // TODO:需要为wcm服务运行规则才能正确返回内容 * /} {} EHL {/ *法定编号(在WCM披露中) // TODO:需要为wcm服务运行规则才能正确返回内容 * /}
{法律}
); 的console.log(this.props.disclosures); } });
console.log(DisclosureList);
export default connect(state => ({
layout: state.template.layout,
footnotes: state.template.footnotes,
disclosures: state.template.disclosures
}))(Footer);
运动模板-standard.jsx
return (
{/ *未来的LeftPanel * /}
{} this.props.children
{} sidebarMarkup
);
错误