Skip to content

Commit

Permalink
Added an extra test
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Mar 24, 2016
1 parent 71a845f commit 2d140c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ <h1>Foobar</h1>
<h6>Barbaz</h6>
</div>

<div class="test" id="test-12">
<h1>Foobar</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<h1>Barbaz</h1>
</div>

</div>

<script src="../index.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,11 @@ describe('Heading outline', function () {
expect(warnings.length).to.be.equal(1)
expect(warnings[0].node).to.be.equal(container.querySelector('h6'))
})

it('should return no warning for a container with a sibling headings (h1 -> h1)', function () {
var container = document.getElementById('test-12')
var o = new Outline(container)
var warnings = o.audit()
expect(warnings.length).to.be.equal(0)
})
})

0 comments on commit 2d140c4

Please sign in to comment.