@@ -124,6 +124,13 @@ describe('Draft Component', () => {
124124 isLoadedSections : [ { title : 'Section 1' , content : 'Content of section 1' } ,
125125 { title : 'Section 2' , content : 'Content of section 2.' }
126126 ] ,
127+ draftedDocument : {
128+ sections : [
129+ { title : 'Section 1' , content : 'Content of section 1' } ,
130+ { title : 'Section 2' , content : 'Content of section 2.' }
131+ ]
132+ } ,
133+ draftedDocumentTitle : '' , // this must be explicitly ''
127134 }
128135 renderComponent ( mockStateWithIncompleteLoad )
129136 await waitFor ( ( ) => {
@@ -139,6 +146,13 @@ describe('Draft Component', () => {
139146 isLoadedSections : [ { title : 'Section 1' , content : 'Content of section 1' } ,
140147 { title : 'Section 2' , content : 'Content of section 2.' }
141148 ] ,
149+ draftedDocument : {
150+ sections : [
151+ { title : 'Section 1' , content : 'Content of section 1' } ,
152+ { title : 'Section 2' , content : 'Content of section 2.' }
153+ ]
154+ } ,
155+ draftedDocumentTitle : '' , // critical for button to be enabled
142156 }
143157 renderComponent ( mockStateWithIncompleteLoad )
144158
@@ -231,6 +245,13 @@ describe('Draft Component', () => {
231245 isLoadedSections : [ { title : 'Section 1' , content : 'Content of section 1' } ,
232246 { title : 'Section 2' , content : 'Content of section 2.' }
233247 ] , // One section not loaded
248+ draftedDocument : {
249+ sections : [
250+ { title : 'Section 1' , content : 'Content of section 1' } ,
251+ { title : 'Section 2' , content : 'Content of section 2.' }
252+ ]
253+ } ,
254+ draftedDocumentTitle : '' , // must be empty string
234255 }
235256 renderComponent ( mockStateWithIncompleteLoad )
236257
@@ -253,7 +274,13 @@ describe('Draft Component', () => {
253274 isLoadedSections : [ { title : 'Section 1' , content : 'Content of section 1' } ,
254275 { title : 'Section 2' , content : 'Content of section 2.' }
255276 ] ,
256- draftedDocumentTitle : null
277+ draftedDocument : {
278+ sections : [
279+ { title : 'Section 1' , content : 'Content of section 1' } ,
280+ { title : 'Section 2' , content : 'Content of section 2.' }
281+ ]
282+ } ,
283+ draftedDocumentTitle : null // allow null here
257284 }
258285 renderComponent ( mockStateWithIncompleteLoad )
259286 await waitFor ( async ( ) => {
0 commit comments