@@ -10,6 +10,7 @@ import multipleParagraphsIssue from "./fixtures/multiple-paragraphs/issue.js";
1010import paragraphConfusingHashesIssue from "./fixtures/paragraph-confusing-####/issue.js" ;
1111import paragraphIgnoreCodeblockIssue from "./fixtures/paragraph-ignore-```/issue.js" ;
1212import paragraphIgnoreCodeblockShIssue from "./fixtures/paragraph-ignore-```sh/issue.js" ;
13+ import checkboxesInTextareaIssue from "./fixtures/checkboxes-in-textarea/issue.js" ;
1314
1415function loadJson ( path ) {
1516 return JSON . parse ( readFileSync ( path , "utf-8" ) ) ;
@@ -304,6 +305,45 @@ it("paragraph with ```sh section", () => {
304305 expect ( core . setOutput . mock . calls . length ) . toBe ( 2 )
305306} ) ;
306307
308+ it ( "checkboxes in textarea" , ( ) => {
309+ const expectedOutput = loadJson ( "./fixtures/checkboxes-in-textarea/expected.json" ) ;
310+ const expectedOutputJson = JSON . stringify ( expectedOutput , null , 2 ) ;
311+
312+ // mock ENV
313+ const env = {
314+ HOME : "<home path>" ,
315+ } ;
316+
317+ // mock event payload
318+ const eventPayload = checkboxesInTextareaIssue ;
319+
320+ // mock fs
321+ const fs = {
322+ readFileSync ( path , encoding ) {
323+ expect ( path ) . toBe ( "<template-path>" ) ;
324+ expect ( encoding ) . toBe ( "utf8" ) ;
325+ return readFileSync ( "fixtures/checkboxes-in-textarea/form.yml" , "utf-8" ) ;
326+ } ,
327+ writeFileSync ( path , content ) {
328+ expect ( path ) . toBe ( "<home path>/issue-parser-result.json" ) ;
329+ expect ( content ) . toBe ( expectedOutputJson ) ;
330+ } ,
331+ } ;
332+
333+ // mock core
334+ const core = {
335+ getInput : jest . fn ( ( ) => '<template-path>' ) ,
336+ setOutput : jest . fn ( ) ,
337+ } ;
338+
339+ run ( env , eventPayload , fs , core ) ;
340+
341+ expect ( core . getInput ) . toHaveBeenCalledWith ( 'template-path' )
342+ expect ( core . setOutput ) . toHaveBeenCalledWith ( 'jsonString' , JSON . stringify ( expectedOutput , null , 2 ) )
343+ expect ( core . setOutput ) . toHaveBeenCalledWith ( 'issueparser_description' , 'Some text:\n\n- [ ] Red\n- [ ] Green\n- [ ] Blue\n\nMore text' )
344+ expect ( core . setOutput . mock . calls . length ) . toBe ( 2 )
345+ } ) ;
346+
307347it ( "blank" , ( ) => {
308348 const expectedOutput = loadJson ( "./fixtures/blank/expected.json" ) ;
309349 const expectedOutputJson = JSON . stringify ( expectedOutput , null , 2 ) ;
0 commit comments