mirror of
https://github.com/docsifyjs/docsify.git
synced 2026-10-17 04:31:18 +08:00
test: add unit test for table cell embedding functionality (#2629)
This commit is contained in:
@@ -177,7 +177,7 @@ export class Compiler {
|
||||
origin.image = imageCompiler({ renderer, contentBase, router });
|
||||
origin.list = taskListCompiler({ renderer });
|
||||
origin.listitem = taskListItemCompiler({ renderer });
|
||||
origin.tablecell = tableCellCompiler({ renderer, compiler: this });
|
||||
origin.tablecell = tableCellCompiler({ renderer });
|
||||
|
||||
renderer.origin = origin;
|
||||
|
||||
|
||||
@@ -180,11 +180,11 @@ describe('Creating a Docsify site (integration tests in Jest)', function () {
|
||||
# Embed Test
|
||||
|
||||
[filename](_media/example1.js ':include :type=code :fragment=demo')
|
||||
|
||||
|
||||
[filename](_media/example2.js ":include :type=code :fragment=something")
|
||||
|
||||
|
||||
# Text between
|
||||
|
||||
|
||||
[filename](_media/example3.js ':include :fragment=something_else_not_code')
|
||||
|
||||
# Text after
|
||||
@@ -226,4 +226,28 @@ describe('Creating a Docsify site (integration tests in Jest)', function () {
|
||||
expect(mainText).not.toContain('console.log(example2);');
|
||||
expect(mainText).not.toContain('console.log(example3);');
|
||||
});
|
||||
|
||||
test('embed file table cell', async () => {
|
||||
await docsifyInit({
|
||||
markdown: {
|
||||
homepage: `
|
||||
# Embed Test
|
||||
|
||||
Command | Description | Parameters
|
||||
---: | --- | ---
|
||||
**Something** | |
|
||||
\`do-something\` | Does something. | [include content](_media/content.md ':include')
|
||||
**Something else** | |
|
||||
\`etc.\` | Etc. | |
|
||||
`,
|
||||
},
|
||||
routes: {
|
||||
'_media/content.md': `this is include content`,
|
||||
},
|
||||
});
|
||||
|
||||
const mainText = document.querySelector('#main').textContent;
|
||||
expect(mainText).toContain('Something');
|
||||
expect(mainText).toContain('this is include content');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user