Skip to content

Commit 3f1311c

Browse files
committed
Fixed tests
1 parent 19d7e41 commit 3f1311c

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
lib
3-
.idea
3+
.idea
4+
coverage

__tests__/renderEmail.test.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchenSink.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Box, Email, Image, Item, Span, A } from '../src/index'
2+
import { Box, Email, Image, Item, Span, A, Row, Col } from '../src/index'
33

44
const css = `
55
@media only screen and (max-device-width: 480px) {
@@ -22,6 +22,12 @@ const email = (
2222
</Item>
2323
</Box>
2424
</Item>
25+
<Item>
26+
<Row>
27+
<Col>Column1</Col>
28+
<Col>Column2</Col>
29+
</Row>
30+
</Item>
2531
</Email>
2632
)
2733

src/components/A.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function A(props) {
1010
download={props.download}
1111
href={props.href}
1212
target="_blank"
13+
rel="noopener noreferrer"
1314
style={{
1415
color: props.color,
1516
textDecoration: props.textDecoration,

src/components/Col.js renamed to src/components/Col.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
import React, { PropTypes } from 'react'
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import EmailPropTypes from '../PropTypes'
34
import includeDataProps from '../includeDataProps'
45

56
export default function Col(props) {
67
return (
7-
<td {...includeDataProps(props)}
8+
<td
9+
{...includeDataProps(props)}
810
className={props.className}
911
align={props.align}
1012
valign={props.valign}
1113
bgcolor={props.bgcolor}
1214
colSpan={props.colSpan}
13-
style={props.style}>
15+
style={props.style}
16+
>
1417
{props.children}
1518
</td>
1619
)
@@ -27,6 +30,8 @@ Col.propTypes = {
2730
}
2831

2932
Col.defaultProps = {
33+
colSpan: null,
34+
children: null,
3035
className: null,
3136
bgcolor: null,
3237
align: 'center',

src/components/Row.js renamed to src/components/Row.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import React, { PropTypes } from 'react'
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import EmailPropTypes from '../PropTypes'
34
import includeDataProps from '../includeDataProps'
45

56
export default function Row(props) {
67
return (
7-
<tr {...includeDataProps(props)}
8+
<tr
9+
{...includeDataProps(props)}
810
className={props.className}
911
align={props.align}
1012
valign={props.valign}
1113
bgcolor={props.bgcolor}
12-
style={props.style}>
14+
style={props.style}
15+
>
1316
{props.children}
1417
</tr>
1518
)
@@ -25,6 +28,7 @@ Row.propTypes = {
2528
}
2629

2730
Row.defaultProps = {
31+
children: null,
2832
className: null,
2933
bgcolor: null,
3034
align: 'center',

0 commit comments

Comments
 (0)