Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit 71679dc

Browse files
authored
set alt text to empty string on Image (fixes #82) (#102)
1 parent c00b270 commit 71679dc

File tree

3 files changed

+61
-35
lines changed

3 files changed

+61
-35
lines changed

Image/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Image.propTypes = {
9191
};
9292

9393
Image.defaultProps = {
94-
alt: 'Image',
94+
alt: '',
9595
};
9696

9797
export default Image;

Image/story.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,10 @@ storiesOf('Image')
100100
src={'http://lorempixel.com/400/400/cats/'}
101101
border={'rounded'}
102102
/>
103+
))
104+
.add('alt', () => (
105+
<Image
106+
src={'nah'}
107+
alt={'alt text'}
108+
/>
103109
));

__snapshots__/snapshot.test.js.snap

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4525,7 +4525,7 @@ exports[`Snapshots IdTag Default 1`] = `
45254525
exports[`Snapshots Image Default 1`] = `
45264526
<span>
45274527
<img
4528-
alt="Image"
4528+
alt=""
45294529
src="http://lorempixel.com/400/400/cats/"
45304530
style={
45314531
Object {
@@ -4545,7 +4545,7 @@ exports[`Snapshots Image Default 1`] = `
45454545
exports[`Snapshots Image MH=10em 1`] = `
45464546
<span>
45474547
<img
4548-
alt="Image"
4548+
alt=""
45494549
src="http://lorempixel.com/400/400/cats/"
45504550
style={
45514551
Object {
@@ -4565,7 +4565,7 @@ exports[`Snapshots Image MH=10em 1`] = `
45654565
exports[`Snapshots Image MW=10em 1`] = `
45664566
<span>
45674567
<img
4568-
alt="Image"
4568+
alt=""
45694569
src="http://lorempixel.com/400/400/cats/"
45704570
style={
45714571
Object {
@@ -4585,7 +4585,7 @@ exports[`Snapshots Image MW=10em 1`] = `
45854585
exports[`Snapshots Image MinH=14em 1`] = `
45864586
<span>
45874587
<img
4588-
alt="Image"
4588+
alt=""
45894589
src="http://lorempixel.com/100/100/cats/"
45904590
style={
45914591
Object {
@@ -4605,7 +4605,7 @@ exports[`Snapshots Image MinH=14em 1`] = `
46054605
exports[`Snapshots Image MinW=14em 1`] = `
46064606
<span>
46074607
<img
4608-
alt="Image"
4608+
alt=""
46094609
src="http://lorempixel.com/100/100/cats/"
46104610
style={
46114611
Object {
@@ -4625,7 +4625,7 @@ exports[`Snapshots Image MinW=14em 1`] = `
46254625
exports[`Snapshots Image W=10em H=10em 1`] = `
46264626
<span>
46274627
<img
4628-
alt="Image"
4628+
alt=""
46294629
src="http://lorempixel.com/400/400/cats/"
46304630
style={
46314631
Object {
@@ -4645,7 +4645,7 @@ exports[`Snapshots Image W=10em H=10em 1`] = `
46454645
exports[`Snapshots Image W=40px H=40px 1`] = `
46464646
<span>
46474647
<img
4648-
alt="Image"
4648+
alt=""
46494649
src="http://lorempixel.com/400/400/cats/"
46504650
style={
46514651
Object {
@@ -4665,7 +4665,7 @@ exports[`Snapshots Image W=40px H=40px 1`] = `
46654665
exports[`Snapshots Image W=100% 1`] = `
46664666
<span>
46674667
<img
4668-
alt="Image"
4668+
alt=""
46694669
src="http://lorempixel.com/400/400/cats/"
46704670
style={
46714671
Object {
@@ -4682,10 +4682,30 @@ exports[`Snapshots Image W=100% 1`] = `
46824682
</span>
46834683
`;
46844684

4685+
exports[`Snapshots Image alt 1`] = `
4686+
<span>
4687+
<img
4688+
alt="alt text"
4689+
src="nah"
4690+
style={
4691+
Object {
4692+
"height": undefined,
4693+
"maxHeight": undefined,
4694+
"maxWidth": undefined,
4695+
"minHeight": undefined,
4696+
"minWidth": undefined,
4697+
"objectFit": undefined,
4698+
"width": undefined,
4699+
}
4700+
}
4701+
/>
4702+
</span>
4703+
`;
4704+
46854705
exports[`Snapshots Image border: circle 1`] = `
46864706
<span>
46874707
<img
4688-
alt="Image"
4708+
alt=""
46894709
src="http://lorempixel.com/400/400/cats/"
46904710
style={
46914711
Object {
@@ -4706,7 +4726,7 @@ exports[`Snapshots Image border: circle 1`] = `
47064726
exports[`Snapshots Image border: rounded 1`] = `
47074727
<span>
47084728
<img
4709-
alt="Image"
4729+
alt=""
47104730
src="http://lorempixel.com/400/400/cats/"
47114731
style={
47124732
Object {
@@ -4727,7 +4747,7 @@ exports[`Snapshots Image border: rounded 1`] = `
47274747
exports[`Snapshots Image small image 1`] = `
47284748
<span>
47294749
<img
4730-
alt="Image"
4750+
alt=""
47314751
src="http://lorempixel.com/50/50/cats/"
47324752
style={
47334753
Object {
@@ -4747,7 +4767,7 @@ exports[`Snapshots Image small image 1`] = `
47474767
exports[`Snapshots Image tall image 1`] = `
47484768
<span>
47494769
<img
4750-
alt="Image"
4770+
alt=""
47514771
src="http://lorempixel.com/400/1000/cats/"
47524772
style={
47534773
Object {
@@ -4767,7 +4787,7 @@ exports[`Snapshots Image tall image 1`] = `
47674787
exports[`Snapshots Image verticalAlignBottom 1`] = `
47684788
<span>
47694789
<img
4770-
alt="Image"
4790+
alt=""
47714791
src="http://lorempixel.com/400/400/cats/"
47724792
style={
47734793
Object {
@@ -4788,7 +4808,7 @@ exports[`Snapshots Image verticalAlignBottom 1`] = `
47884808
exports[`Snapshots Image wide image 1`] = `
47894809
<span>
47904810
<img
4791-
alt="Image"
4811+
alt=""
47924812
src="http://lorempixel.com/1000/400/cats/"
47934813
style={
47944814
Object {
@@ -15058,7 +15078,7 @@ exports[`Snapshots MultipleImages border=rounded 1`] = `
1505815078
}
1505915079
>
1506015080
<img
15061-
alt="Image"
15081+
alt=""
1506215082
src="http://lorempixel.com/400/400/cats/"
1506315083
style={
1506415084
Object {
@@ -15085,7 +15105,7 @@ exports[`Snapshots MultipleImages border=rounded 1`] = `
1508515105
}
1508615106
>
1508715107
<img
15088-
alt="Image"
15108+
alt=""
1508915109
src="http://lorempixel.com/400/400/cats/"
1509015110
style={
1509115111
Object {
@@ -15112,7 +15132,7 @@ exports[`Snapshots MultipleImages border=rounded 1`] = `
1511215132
}
1511315133
>
1511415134
<img
15115-
alt="Image"
15135+
alt=""
1511615136
src="http://lorempixel.com/400/400/cats/"
1511715137
style={
1511815138
Object {
@@ -15139,7 +15159,7 @@ exports[`Snapshots MultipleImages border=rounded 1`] = `
1513915159
}
1514015160
>
1514115161
<img
15142-
alt="Image"
15162+
alt=""
1514315163
src="http://lorempixel.com/400/400/cats/"
1514415164
style={
1514515165
Object {
@@ -15182,7 +15202,7 @@ exports[`Snapshots MultipleImages fourImages 1`] = `
1518215202
}
1518315203
>
1518415204
<img
15185-
alt="Image"
15205+
alt=""
1518615206
src="http://lorempixel.com/400/400/cats/"
1518715207
style={
1518815208
Object {
@@ -15209,7 +15229,7 @@ exports[`Snapshots MultipleImages fourImages 1`] = `
1520915229
}
1521015230
>
1521115231
<img
15212-
alt="Image"
15232+
alt=""
1521315233
src="http://lorempixel.com/400/400/cats/"
1521415234
style={
1521515235
Object {
@@ -15236,7 +15256,7 @@ exports[`Snapshots MultipleImages fourImages 1`] = `
1523615256
}
1523715257
>
1523815258
<img
15239-
alt="Image"
15259+
alt=""
1524015260
src="http://lorempixel.com/400/400/cats/"
1524115261
style={
1524215262
Object {
@@ -15263,7 +15283,7 @@ exports[`Snapshots MultipleImages fourImages 1`] = `
1526315283
}
1526415284
>
1526515285
<img
15266-
alt="Image"
15286+
alt=""
1526715287
src="http://lorempixel.com/400/400/cats/"
1526815288
style={
1526915289
Object {
@@ -15306,7 +15326,7 @@ exports[`Snapshots MultipleImages oneImage 1`] = `
1530615326
}
1530715327
>
1530815328
<img
15309-
alt="Image"
15329+
alt=""
1531015330
src="http://lorempixel.com/400/400/cats/"
1531115331
style={
1531215332
Object {
@@ -15349,7 +15369,7 @@ exports[`Snapshots MultipleImages threeImages 1`] = `
1534915369
}
1535015370
>
1535115371
<img
15352-
alt="Image"
15372+
alt=""
1535315373
src="http://lorempixel.com/400/400/cats/"
1535415374
style={
1535515375
Object {
@@ -15376,7 +15396,7 @@ exports[`Snapshots MultipleImages threeImages 1`] = `
1537615396
}
1537715397
>
1537815398
<img
15379-
alt="Image"
15399+
alt=""
1538015400
src="http://lorempixel.com/400/400/cats/"
1538115401
style={
1538215402
Object {
@@ -15403,7 +15423,7 @@ exports[`Snapshots MultipleImages threeImages 1`] = `
1540315423
}
1540415424
>
1540515425
<img
15406-
alt="Image"
15426+
alt=""
1540715427
src="http://lorempixel.com/400/400/cats/"
1540815428
style={
1540915429
Object {
@@ -15446,7 +15466,7 @@ exports[`Snapshots MultipleImages twoImages 1`] = `
1544615466
}
1544715467
>
1544815468
<img
15449-
alt="Image"
15469+
alt=""
1545015470
src="http://lorempixel.com/400/400/cats/"
1545115471
style={
1545215472
Object {
@@ -15473,7 +15493,7 @@ exports[`Snapshots MultipleImages twoImages 1`] = `
1547315493
}
1547415494
>
1547515495
<img
15476-
alt="Image"
15496+
alt=""
1547715497
src="http://lorempixel.com/400/400/cats/"
1547815498
style={
1547915499
Object {
@@ -15516,7 +15536,7 @@ exports[`Snapshots MultipleImages width=30rem, height=30rem 1`] = `
1551615536
}
1551715537
>
1551815538
<img
15519-
alt="Image"
15539+
alt=""
1552015540
src="http://lorempixel.com/400/400/cats/"
1552115541
style={
1552215542
Object {
@@ -15543,7 +15563,7 @@ exports[`Snapshots MultipleImages width=30rem, height=30rem 1`] = `
1554315563
}
1554415564
>
1554515565
<img
15546-
alt="Image"
15566+
alt=""
1554715567
src="http://lorempixel.com/400/400/cats/"
1554815568
style={
1554915569
Object {
@@ -15570,7 +15590,7 @@ exports[`Snapshots MultipleImages width=30rem, height=30rem 1`] = `
1557015590
}
1557115591
>
1557215592
<img
15573-
alt="Image"
15593+
alt=""
1557415594
src="http://lorempixel.com/400/400/cats/"
1557515595
style={
1557615596
Object {
@@ -15597,7 +15617,7 @@ exports[`Snapshots MultipleImages width=30rem, height=30rem 1`] = `
1559715617
}
1559815618
>
1559915619
<img
15600-
alt="Image"
15620+
alt=""
1560115621
src="http://lorempixel.com/400/400/cats/"
1560215622
style={
1560315623
Object {
@@ -15780,7 +15800,7 @@ exports[`Snapshots Overlay default 1`] = `
1578015800
}
1578115801
>
1578215802
<img
15783-
alt="Image"
15803+
alt=""
1578415804
src="http://lorempixel.com/400/400/cats/"
1578515805
style={
1578615806
Object {
@@ -15823,7 +15843,7 @@ exports[`Snapshots Overlay transparent=true 1`] = `
1582315843
}
1582415844
>
1582515845
<img
15826-
alt="Image"
15846+
alt=""
1582715847
src="http://lorempixel.com/400/400/cats/"
1582815848
style={
1582915849
Object {

0 commit comments

Comments
 (0)