From 370799ac555676bbef44fe27a569307b7e0d5232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Sat, 7 Feb 2015 20:35:24 +0100 Subject: [PATCH] Add test for #595: glossary links in subpages --- test/fixtures/test1/sub/test1.md | 2 ++ test/glossary.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/test/fixtures/test1/sub/test1.md b/test/fixtures/test1/sub/test1.md index 6a6e7883b..d45a4dd11 100644 --- a/test/fixtures/test1/sub/test1.md +++ b/test/fixtures/test1/sub/test1.md @@ -4,3 +4,5 @@ This is a relative link [test](../intro.md). ![image](../image.png) +This is a glossary link. + diff --git a/test/glossary.js b/test/glossary.js index 442f857ef..da2cbb112 100644 --- a/test/glossary.js +++ b/test/glossary.js @@ -19,4 +19,16 @@ describe('Glossary Generation', function () { assert($a.text() == "description"); }, done); }); + + it('should correctly replace glossary terms in sub pages', function(done) { + testGeneration(books[1], "website", function(output) { + var content = fs.readFileSync(path.join(output, "sub/test1.html"), { encoding: "utf8" }); + var $ = cheerio.load(content); + + var $body = $(".page-inner"); + var $a = $("a[href='../GLOSSARY.html#test']"); + assert($a.length == 1); + assert($a.text() == "a test text"); + }, done); + }); });