File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ exports[`<Image /> when receives a Image block without actions renders a <figure
29
29
</figure >
30
30
`;
31
31
32
+ exports[`<Image /> when receives a Image block without name renders a <figure > block with <img > and <figcaption > 1`] = `
33
+ <figure >
34
+ <img
35
+ alt = " Deep in the universe"
36
+ src = " https://cdn.directions.pt/uploads/2020/08/681-2000x1300-2.jpg"
37
+ />
38
+ <figcaption >
39
+ Deep in the universe
40
+ </figcaption >
41
+ </figure >
42
+ `;
43
+
32
44
exports[`<Image /> when receives a SimpleImage block renders a <figure > block with <img > and <figcaption > 1`] = `
33
45
<figure >
34
46
<img
Original file line number Diff line number Diff line change @@ -37,6 +37,22 @@ describe('<Image />', () => {
37
37
} ) ;
38
38
} ) ;
39
39
40
+ describe ( 'when receives a Image block without name' , ( ) => {
41
+ const data : ImageBlockData = {
42
+ file : {
43
+ url : 'https://cdn.directions.pt/uploads/2020/08/681-2000x1300-2.jpg' ,
44
+ } ,
45
+ caption : 'Deep in the universe' ,
46
+ withBorder : false ,
47
+ stretched : false ,
48
+ withBackground : false ,
49
+ } ;
50
+
51
+ it ( 'renders a <figure> block with <img> and <figcaption>' , ( ) => {
52
+ expect ( create ( < Image data = { data } /> ) . toJSON ( ) ) . toMatchSnapshot ( ) ;
53
+ } ) ;
54
+ } ) ;
55
+
40
56
describe ( 'when receives a SimpleImage block' , ( ) => {
41
57
const data : ImageBlockData = {
42
58
url : 'https://cdn.directions.pt/uploads/2020/08/681-2000x1300-2.jpg' ,
You can’t perform that action at this time.
0 commit comments