File tree 5 files changed +661
-317
lines changed
5 files changed +661
-317
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ function noop() {
2
2
return null ;
3
3
}
4
4
5
+ require . extensions [ '.css' ] = noop ;
5
6
require . extensions [ '.less' ] = noop ;
6
7
require . extensions [ '.png' ] = noop ;
7
8
// ..etc
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import './index.less'
4
4
import { Link } from 'react-router'
5
5
6
6
const contextTypes = {
7
- router : PropTypes . object . isRequired
7
+ router : PropTypes . object
8
8
} ;
9
9
10
10
const { Header } = Layout ;
@@ -56,7 +56,7 @@ export default class commonHeader extends React.Component {
56
56
< Col span = { 3 } >
57
57
< Dropdown overlay = { menu } >
58
58
< a className = "ant-dropdown-link" href = "#" >
59
- < Icon type = "user" /> { username } < Icon type = "down" />
59
+ < Icon type = "user" /> < span > { username } </ span > < Icon type = "down" />
60
60
</ a >
61
61
</ Dropdown >
62
62
</ Col >
Original file line number Diff line number Diff line change 19
19
width : 100% ;
20
20
}
21
21
}
22
+ .ant-input-affix-wrapper {
23
+ .ant-input {
24
+ min-height : auto ;
25
+ }
26
+ }
22
27
}
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { expect } from 'chai' ;
3
3
import { shallow , mount , render } from 'enzyme' ;
4
- import Header from '../src/components/Header/Header' ;
4
+ import Header from '../src/components/Header/index.jsx' ;
5
+
6
+ let auth = {
7
+ user : {
8
+ name : "fireyy"
9
+ }
10
+ } ;
11
+ let logout = ( ) => { } ;
5
12
6
13
describe ( "<Header />" , function ( ) {
7
- it ( "shallow " , function ( ) {
8
- expect ( shallow ( < Header /> ) . is ( '.ant-layout-header' ) ) . to . equal ( true ) ;
14
+ it ( "mount " , function ( ) {
15
+ expect ( mount ( < Header profile = { auth } logout = { logout } /> ) . find ( '.ant-layout-header' ) . length ) . to . equal ( 1 ) ;
9
16
} ) ;
10
17
11
- it ( "mount " , function ( ) {
12
- expect ( mount ( < Header /> ) . find ( '.ant-layout-header ' ) . length ) . to . equal ( 1 ) ;
18
+ it ( "pass user profile " , function ( ) {
19
+ expect ( mount ( < Header profile = { auth } logout = { logout } /> ) . find ( '.ant-dropdown-link span ' ) . html ( ) ) . to . contain ( 'fireyy' ) ;
13
20
} ) ;
14
21
} ) ;
You can’t perform that action at this time.
0 commit comments