@@ -14,6 +14,7 @@ describe('Blocks', () => {
14
14
blocks = [
15
15
factory . getBlockTitleNode ( { text : 'My Title' } ) ,
16
16
factory . getBlockTextNode ( { text : 'My text.' } ) ,
17
+ factory . getBlockYoutubeNode ( { title : 'My video.' } ) ,
17
18
]
18
19
} )
19
20
@@ -25,11 +26,13 @@ describe('Blocks', () => {
25
26
26
27
const text = getByText ( 'My text.' )
27
28
expect ( text ) . toBeTruthy ( )
29
+
30
+ const youTubeTitle = getByText ( 'My video.' )
31
+ expect ( youTubeTitle ) . toBeTruthy ( )
28
32
} )
29
33
30
34
it ( 'gracefully drops unimplemented block types' , ( ) => {
31
35
blocks = blocks . concat ( [
32
- factory . getBlockYoutubeNode ( ) ,
33
36
factory . getBlockTimelineNode ( ) ,
34
37
factory . getBlockImageNode ( ) ,
35
38
factory . getBlockCardNode ( ) ,
@@ -42,9 +45,6 @@ describe('Blocks', () => {
42
45
const text = getByText ( 'My text.' )
43
46
expect ( text ) . toBeTruthy ( )
44
47
45
- const youtube = queryByText ( 'youtube' )
46
- expect ( youtube ) . toBeFalsy ( )
47
-
48
48
const timelineEntry = queryByText ( '2020' )
49
49
expect ( timelineEntry ) . toBeFalsy ( )
50
50
@@ -84,7 +84,13 @@ describe('Block', () => {
84
84
expect ( text ) . toBeTruthy ( )
85
85
} )
86
86
87
- test . todo ( 'can render a youtube block' )
87
+ it ( 'can render a youtube block' , ( ) => {
88
+ const block = factory . getBlockYoutubeNode ( { title : 'My video.' } )
89
+ const { getByText } = render ( < Block block = { block } /> )
90
+ const text = getByText ( 'My video.' )
91
+ expect ( text ) . toBeTruthy ( )
92
+ } )
93
+
88
94
test . todo ( 'can render a timeline block' )
89
95
test . todo ( 'can render a links list block' )
90
96
test . todo ( 'can render an updates list block' )
0 commit comments