Skip to content

Commit

Permalink
adjust web parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robertKozik committed May 10, 2024
1 parent 4fde21c commit c2c9732
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/__tests__/webParser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ describe('quote', () => {
test('with multiple spaces', () => {
expect('> Hello world!').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span> Hello world!</span>');
});

test('without space', () => {
expect('>Hello world!').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span>Hello world!</span>');
});
});

test('multiple blockquotes', () => {
Expand All @@ -185,8 +181,8 @@ test('separate blockquotes', () => {
});

test('nested blockquotes', () => {
expect('>>>> Lorem ipsum dolor sit amet').toBeParsedAsHTML(
'<span class="blockquote"><span class="blockquote"><span class="blockquote"><span class="syntax">&gt;</span><span class="syntax">&gt;</span><span class="syntax">&gt;</span>&gt; Lorem ipsum dolor sit amet</span></span></span>',
expect('> > > > Lorem ipsum dolor sit amet').toBeParsedAsHTML(
'<span class="blockquote"><span class="blockquote"><span class="blockquote"><span class="blockquote"><span class="syntax">&gt;</span> <span class="syntax">&gt;</span> <span class="syntax">&gt;</span> <span class="syntax">&gt;</span> Lorem ipsum dolor sit amet</span></span></span></span>',
);
});

Expand All @@ -201,16 +197,12 @@ test('nested bold and italic', () => {
});

describe('nested heading in blockquote', () => {
test('without spaces', () => {
expect('># Hello world').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span><span class="syntax"># </span><span class="h1">Hello world</span></span>');
});

test('with single space', () => {
expect('> # Hello world').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span> <span class="syntax"># </span><span class="h1">Hello world</span></span>');
});

test('with multiple spaces after #', () => {
expect('># Hello world').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span><span class="syntax"># </span><span class="h1"> Hello world</span></span>');
expect('> # Hello world').toBeParsedAsHTML('<span class="blockquote"><span class="syntax">&gt;</span> <span class="syntax"># </span><span class="h1"> Hello world</span></span>');
});
});

Expand Down

0 comments on commit c2c9732

Please sign in to comment.