Skip to content

Commit

Permalink
chore: update snapshots
Browse files Browse the repository at this point in the history
update snapshot 2

update snapshot 3

update snapshot 4
  • Loading branch information
martyanovandrey committed Sep 2, 2024
1 parent 0467211 commit 1e587eb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/__snapshots__/block-anchor.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`block-anchor handles multiple anchors in the input 1`] = `
`;

exports[`block-anchor parses anchors surrounded by other blocks 1`] = `
"<h1 id=\\"heading\\"><a href=\\"#heading\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\">Heading</span></a>Heading</h1>
"<h1 id=\\"heading\\"><a href=\\"#heading\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Heading</span></a>Heading</h1>
<hr id=\\"my-anchor\\" class=\\"visually-hidden\\" /><p>paragraph with content</p>
"
`;
Expand All @@ -25,6 +25,6 @@ exports[`block-anchor parses block anchors 1`] = `
exports[`block-anchor renders block-anchor 1`] = `"<hr id=\\"my-anchor\\" class=\\"visually-hidden\\" />"`;

exports[`block-anchor works with heading anchors 1`] = `
"<h1 id=\\"heading-anchor\\"><a href=\\"#heading-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\">Heading</span></a>Heading</h1>
"<h1 id=\\"heading-anchor\\"><a href=\\"#heading-anchor\\" class=\\"yfm-anchor\\" aria-hidden=\\"true\\"><span class=\\"visually-hidden\\" data-no-index=\\"true\\">Heading</span></a>Heading</h1>
<hr id=\\"my-anchor\\" class=\\"visually-hidden\\" />"
`;
14 changes: 7 additions & 7 deletions test/__snapshots__/term.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Terms Should create term in code with definition template 1`] = `
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"tooltip\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"dialog\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
</dfn></template><h1>Web</h1>
<div class=\\"yfm-clipboard\\">
Expand All @@ -22,7 +22,7 @@ exports[`Terms Should create term in code with definition template 1`] = `
`;
exports[`Terms Should create term in table with definition template 1`] = `
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"tooltip\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"dialog\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
</dfn></template><h1>Web</h1>
<table>
<thead>
Expand All @@ -33,7 +33,7 @@ exports[`Terms Should create term in table with definition template 1`] = `
</thead>
<tbody>
<tr>
<td><i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"term\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i></td>
<td><i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"button\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i></td>
<td style=\\"text-align:center\\">1993</td>
</tr>
</tbody>
Expand All @@ -42,15 +42,15 @@ exports[`Terms Should create term in table with definition template 1`] = `
`;
exports[`Terms Should create term in text with definition template 1`] = `
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"tooltip\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"dialog\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
</dfn></template><h1>Web</h1>
<p>The <i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"term\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i> specification</p>
<p>The <i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"button\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i> specification</p>
"
`;
exports[`Terms Term should use content from include 1`] = `
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"tooltip\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
"<template id=\\":html_template\\" label=\\"html\\"><dfn class=\\"yfm yfm-term_dfn\\" id=\\":html_element\\" role=\\"dialog\\"><p>The HyperText Markup Language or <strong>HTML</strong> is the standard markup language for documents designed to be displayed in a web browser.</p>
</dfn></template><h1>Web</h1>
<p>The <i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"term\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i> specification</p>
<p>The <i class=\\"yfm yfm-term_title\\" term-key=\\":html\\" role=\\"button\\" aria-describedby=\\":html_element\\" tabindex=\\"0\\" id=\\"\\">HTML</i> specification</p>
"
`;
30 changes: 15 additions & 15 deletions test/anchors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ describe('Anchors', () => {

it('should add single anchor with auto naming', () => {
expect(transformYfm('## Test\n' + '\n' + 'Content\n')).toBe(
'<h2 id="test"><a href="link.html#test" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>Test</h2>\n' +
'<h2 id="test"><a href="link.html#test" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>Test</h2>\n' +
'<p>Content</p>\n',
);
});

it('should add single anchor', () => {
expect(transformYfm('## Test {#test1}\n' + '\n' + 'Content\n')).toBe(
'<h2 id="test1"><a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>Test</h2>\n' +
'<h2 id="test1"><a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>Test</h2>\n' +
'<p>Content</p>\n',
);
});

it('should add multiple anchors', () => {
expect(transformYfm('## Test {#test1} {#test2} {#test3}\n' + '\n' + 'Content\n')).toBe(
'<h2 id="test1">' +
'<a id="test3" href="link.html#test3" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>' +
'<a id="test2" href="link.html#test2" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>' +
'<a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>Test</h2>\n' +
'<a id="test3" href="link.html#test3" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>' +
'<a id="test2" href="link.html#test2" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>' +
'<a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>Test</h2>\n' +
'<p>Content</p>\n',
);
});
Expand All @@ -58,9 +58,9 @@ describe('Anchors', () => {
'{% include [test](./include-anchor.md) %}\n',
),
).toBe(
'<h2 id="test0"><a href="link.html#test0" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>Test</h2>\n' +
'<h2 id="test0"><a href="link.html#test0" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>Test</h2>\n' +
'<p>Content before include</p>\n' +
'<h1 id="test1"><a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Title</span></a>Title</h1>\n' +
'<h1 id="test1"><a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Title</span></a>Title</h1>\n' +
'<p>Content</p>\n',
);
});
Expand All @@ -75,20 +75,20 @@ describe('Anchors', () => {
'{% include [test](./include-multiple-anchors.md) %}\n',
),
).toBe(
'<h2 id="test0"><a href="link.html#test0" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a>Test</h2>\n' +
'<h2 id="test0"><a href="link.html#test0" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a>Test</h2>\n' +
'<p>Content before include</p>\n' +
'<h1 id="test1">' +
'<a id="test3" href="link.html#test3" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Title</span></a>' +
'<a id="test2" href="link.html#test2" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Title</span></a>' +
'<a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Title</span></a>Title</h1>\n' +
'<a id="test3" href="link.html#test3" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Title</span></a>' +
'<a id="test2" href="link.html#test2" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Title</span></a>' +
'<a href="link.html#test1" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Title</span></a>Title</h1>\n' +
'<p>Content</p>\n',
);
});

it('should be transliterated correctly', () => {
expect(transformYfm('## Максимальный размер дисков \n' + '\n' + 'Content\n')).toBe(
'<h2 id="maksimalnyj-razmer-diskov">' +
'<a href="link.html#maksimalnyj-razmer-diskov" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Максимальный размер дисков</span></a>' +
'<a href="link.html#maksimalnyj-razmer-diskov" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Максимальный размер дисков</span></a>' +
'Максимальный размер дисков' +
'</h2>\n' +
'<p>Content</p>\n',
Expand All @@ -98,7 +98,7 @@ describe('Anchors', () => {
it('should be removed fences after transliteration', () => {
expect(transformYfm('## `Test`\n' + '\n' + 'Content\n')).toBe(
'<h2 id="test">' +
'<a href="link.html#test" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Test</span></a><code>Test</code>' +
'<a href="link.html#test" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Test</span></a><code>Test</code>' +
'</h2>\n' +
'<p>Content</p>\n',
);
Expand All @@ -115,7 +115,7 @@ describe('Anchors', () => {
),
).toBe(
'<p>Content before include</p>\n' +
'<h2 id="anchor"><a href="link.html#anchor" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden">Subtitle</span></a>Subtitle</h2>\n' +
'<h2 id="anchor"><a href="link.html#anchor" class="yfm-anchor" aria-hidden="true"><span class="visually-hidden" data-no-index="true">Subtitle</span></a>Subtitle</h2>\n' +
'<p>Subcontent</p>\n' +
'<p>After include</p>\n',
);
Expand All @@ -125,7 +125,7 @@ describe('Anchors', () => {
expect(transformYfm('## _Lorem ~~ipsum **dolor** sit~~ amet_\n\nParagraph\n')).toBe(
'<h2 id="lorem-ipsum-dolor-sit-amet">' +
'<a href="link.html#lorem-ipsum-dolor-sit-amet" class="yfm-anchor" aria-hidden="true">' +
'<span class="visually-hidden">Lorem ipsum dolor sit amet</span></a>' +
'<span class="visually-hidden" data-no-index="true">Lorem ipsum dolor sit amet</span></a>' +
'<em>Lorem <s>ipsum <strong>dolor</strong> sit</s> amet</em></h2>\n' +
'<p>Paragraph</p>\n',
);
Expand Down

0 comments on commit 1e587eb

Please sign in to comment.