Skip to content

Commit

Permalink
test: add a test for empty lists in nav doc
Browse files Browse the repository at this point in the history
Closes #889
  • Loading branch information
rdeltour committed Jan 14, 2019
1 parent 08123b2 commit 232281c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/adobe/epubcheck/nav/NavCheckerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ public void testValidateDocumentNavNoToc()
testValidateDocument("invalid/nav-no-toc.xhtml");
}

@Test
public void testValidateDocumentNavEmptyList()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
testValidateDocument("invalid/nav-empty-list.xhtml");
}

@Test
public void testValidateDocumentNavReqHeading()
{
Expand Down
27 changes: 27 additions & 0 deletions src/test/resources/30/single/nav/invalid/nav-empty-list.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>Test</title>
</head>
<body>
<nav epub:type="toc">
<h1>Table of contents</h1>
<ol>
<li><a href="chap1.xhtml">Chapter 1</a>
<ol>
<li><a href="chap1.1.xhtml">Chapter 1.1</a></li>
<li><a href="chap1.2.xhtml">Chapter 1.2</a></li>
</ol>
</li>
<li><a href="chap2.xhtml">Chapter 2</a></li>
</ol>
</nav>

<nav epub:type="landmarks">
<!-- the guide -->
<h2>Guide</h2>
<ol>
</ol>
</nav>
</body>
</html>

0 comments on commit 232281c

Please sign in to comment.