Skip to content

Commit

Permalink
Add test case to check variable outputs include (#1324)
Browse files Browse the repository at this point in the history
There are currently no test cases to test the feature where "variable"
can store "include" tags and output the content properly.

Let's add this test case to test_site.
  • Loading branch information
wxwxwxwx9 committed Aug 13, 2020
1 parent 1a5d0c3 commit 7b511eb
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div id="fragment">content fragment</div>
8 changes: 8 additions & 0 deletions packages/cli/test/functional/test_site/expected/siteData.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@
"dates": "Dates"
},
"headingKeywords": {}
},
{
"src": "testVariableContainsInclude.md",
"title": "Variable should be able to store included content fragments",
"headings": {
"content-fragment": "content fragment"
},
"headingKeywords": {}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html>

<head>
<meta name="default-head-top">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="MarkBind 2.15.2">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Variable should be able to store included content fragments</title>
<link rel="stylesheet" href="markbind/css/bootstrap.min.css">
<link rel="stylesheet" href="markbind/css/bootstrap-vue.min.css">
<link rel="stylesheet" href="markbind/fontawesome/css/all.min.css">
<link rel="stylesheet" href="markbind/glyphicons/css/bootstrap-glyphicons.min.css">
<link rel="stylesheet" href="markbind/css/octicons.css">
<link rel="stylesheet" href="markbind/css/github.min.css">
<link rel="stylesheet" href="markbind/css/markbind.css">
<script src="markbind/js/polyfill.min.js"></script>
<script src="markbind/js/vue.min.js"></script>
<script src="markbind/js/components.min.js"></script>
<script src="markbind/js/jquery.min.js"></script>
<link rel="stylesheet" href="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginStylesheet.css">
<link rel="stylesheet" href="/test_site/plugins/markbind-plugin-anchors/markbind-plugin-anchors.css">
<link rel="stylesheet" href="markbind/layouts/default/styles.css">
<meta name="default-head-bottom">
<link rel="icon" href="/test_site/favicon.png">
</head>

<body>
<div id="app">
<div id="flex-body">
<div id="content-wrapper">
<div></div>
<h1 id="content-fragment"><span>content fragment</span><a class="fa fa-anchor" href="#content-fragment" onclick="event.stopPropagation()"></a></h1>
</div>


</div>
<footer>
<div class="text-center">
Default footer
</div>
</footer>
</div>
</body>
<script src="markbind/js/bootstrap-utility.min.js"></script>
<script>
const baseUrl = '/test_site'
const enableSearch = true
</script>
<script src="markbind/js/setup.js"></script>
<script src="/test_site/plugins/testMarkbindPlugin/testMarkbindPluginScript.js"></script>
<script>
alert("Inline plugin script loaded!")
</script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TRACKING-ID"></script>
<script>
window.dataLayer = window.dataLayer || [];

function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'TRACKING-ID');
</script>
<script src="markbind/layouts/default/scripts.js"></script>

</html>
6 changes: 5 additions & 1 deletion packages/cli/test/functional/test_site/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"src": "testAnchorGeneration.md",
"title": "Anchor Generation Test"
},
{
{
"src": "testTooltipSpacing.mbd",
"title": "Tooltip Spacing Test"
},
Expand Down Expand Up @@ -91,6 +91,10 @@
{
"src": "testDates.md",
"title": "Nunjucks date filter tests"
},
{
"src": "testVariableContainsInclude.md",
"title": "Variable should be able to store included content fragments"
}
],
"ignore": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<variable name="test"># <include src="contentFragmentToInclude.md#fragment" inline /></variable>

{{ test }}

0 comments on commit 7b511eb

Please sign in to comment.