Exemplo n.º 1
0
  it('returns entire string if fold not found', () => {
    const input = `
      blog post.
      and another line.

      And another paragraph.
    `;
    expect(getPreFoldContent(input)).to.equal(input);
  });
Exemplo n.º 2
0
  it('does not include the introductory text inside brackets (without <em>)', () => {
    const input = stripIndent`
      <p>[This post is special.]</p>
      intro.
      <div class='fold'></div>
      body.
    `;
    const expected = 'intro.\n';

    expect(getPreFoldContent(input)).to.equal(expected);
  });
Exemplo n.º 3
0
  it('returns only the content before the fold', () => {
    const input = stripIndent`
      blog post.
      and another line.
      <div class='fold'></div>
      And another paragraph.
    `;
    const expected = 'blog post.\nand another line.\n';

    expect(getPreFoldContent(input)).to.equal(expected);
  });
Exemplo n.º 4
0
 it('returns undefined for undefined input', () => {
   expect(getPreFoldContent()).to.equal();
 });
Exemplo n.º 5
0
 it('returns empty string for empty string input', () => {
   expect(getPreFoldContent('')).to.equal('');
 });