{"version":3,"sources":["../../src/sections/examples.test.ts"],"sourcesContent":["import { examplesSection } from './examples.js';\n\ndescribe('Examples', () => {\n  it('should return title only when no items are added', () => {\n    const section = examplesSection();\n    expect(section.synthesize()).toBe('## Examples');\n  });\n\n  it('should return custom title', () => {\n    const section = examplesSection({ title: 'Custom Examples' });\n    expect(section.synthesize()).toMatchInlineSnapshot('\"## Custom Examples\"');\n  });\n\n  it('should return custom title and items', () => {\n    const section = examplesSection({\n      title: 'Custom Examples',\n      items: [\n        {\n          title: 'Test Code',\n          codeblock: {\n            code: `console.log('Hello World!')`,\n            language: 'typescript',\n          },\n        },\n      ],\n    });\n    expect(section.synthesize()).toMatchInlineSnapshot(`\n      \"## Custom Examples\n\n      ### Test Code\n\n      \\`\\`\\`typescript\n      console.log('Hello World!')\n      \\`\\`\\`\n      \"\n    `);\n  });\n\n  it('should return correct syntax when one item is added', () => {\n    const section = examplesSection().add({\n      title: 'Create an example section',\n      description:\n        'The title is defaulted to Examples but can be overridden in the constructor',\n      codeblock: {\n        language: 'typescript',\n        code: 'const section = examplesSection();',\n      },\n    });\n    expect(section.synthesize()).toBe(\n      [\n        '## Examples',\n        '',\n        '### Create an example section',\n        '',\n        'The title is defaulted to Examples but can be overridden in the constructor',\n        '',\n        '```typescript',\n        'const section = examplesSection();',\n        '```',\n        '',\n      ].join('\\n'),\n    );\n  });\n\n  it('should return correct syntax when multiple items are added', () => {\n    const section = examplesSection()\n      .add({\n        title: 'Create an example section',\n        description:\n          'The title is defaulted to Examples but can be overridden in the constructor',\n        codeblock: {\n          language: 'typescript',\n          code: 'const section = examplesSection();',\n        },\n      })\n      .add({\n        title: 'Create an example section',\n        description:\n          'The title is defaulted to Examples but can be overridden in the constructor',\n        codeblock: {\n          language: 'typescript',\n          code: 'const section = examplesSection();',\n        },\n      });\n    expect(section.synthesize()).toBe(\n      [\n        '## Examples',\n        '',\n        '### Create an example section',\n        '',\n        'The title is defaulted to Examples but can be overridden in the constructor',\n        '',\n        '```typescript',\n        'const section = examplesSection();',\n        '```',\n        '',\n        '### Create an example section',\n        '',\n        'The title is defaulted to Examples but can be overridden in the constructor',\n        '',\n        '```typescript',\n        'const section = examplesSection();',\n        '```',\n        '',\n      ].join('\\n'),\n    );\n  });\n\n  it('should return correct syntax when the example has no description', () => {\n    const section = examplesSection().add({\n      title: 'Create an example section',\n      codeblock: {\n        language: 'typescript',\n        code: 'const section = examplesSection();',\n      },\n    });\n    expect(section.synthesize()).toBe(\n      [\n        '## Examples',\n        '',\n        '### Create an example section',\n        '',\n        '```typescript',\n        'const section = examplesSection();',\n        '```',\n        '',\n      ].join('\\n'),\n    );\n  });\n\n  it('should return correct syntax when examples are grouped', () => {\n    const section = examplesSection()\n      .add({\n        title: 'Ungrouped Example',\n        codeblock: {\n          language: 'typescript',\n          code: 'const section = examplesSection();',\n        },\n      })\n      .add({\n        title: 'Grouped Example',\n        group: 'Group 1',\n        codeblock: {\n          language: 'typescript',\n          code: 'const section = examplesSection();',\n        },\n      });\n    expect(section.synthesize()).toMatchInlineSnapshot(`\n      \"## Examples\n\n      ### Ungrouped Example\n\n      \\`\\`\\`typescript\n      const section = examplesSection();\n      \\`\\`\\`\n\n\n      ### Group 1\n\n      #### Grouped Example\n\n      \\`\\`\\`typescript\n      const section = examplesSection();\n      \\`\\`\\`\n      \"\n    `);\n  });\n\n  it('should return correct syntax when using a template literal', () => {\n    const section = examplesSection().add({\n      title: 'Ungrouped Example',\n      codeblock: {\n        language: 'typescript',\n        code: `\n          import { examplesSection } from 'path/to/examples';\n\n          const section = examplesSection();\n        `,\n      },\n    });\n\n    expect(section.synthesize()).toMatchInlineSnapshot(`\n      \"## Examples\n\n      ### Ungrouped Example\n\n      \\`\\`\\`typescript\n      import { examplesSection } from 'path/to/examples';\n\n      const section = examplesSection();\n      \\`\\`\\`\n      \"\n    `);\n  });\n});\n"],"mappings":";AAAA,sBAAgC;AAEhC,SAAS,YAAY,MAAM;AACzB,KAAG,oDAAoD,MAAM;AAC3D,UAAM,cA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