aboutsummaryrefslogtreecommitdiffstats
path: root/docs/spec/domSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'docs/spec/domSpec.js')
-rw-r--r--docs/spec/domSpec.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/spec/domSpec.js b/docs/spec/domSpec.js
index 5175b91a..7bc6a7f4 100644
--- a/docs/spec/domSpec.js
+++ b/docs/spec/domSpec.js
@@ -28,6 +28,24 @@ describe('dom', function() {
expect(dom.toString()).toContain('<h2>sub-heading</h2>');
});
+ it('should properly number nested headings', function() {
+ dom.h('heading', function() {
+ dom.h('heading2', function() {
+ this.html('<h1>heading3</h1>');
+ });
+ });
+ dom.h('other1', function() {
+ this.html('<h1>other2</h1>');
+ });
+
+ expect(dom.toString()).toContain('<h1 id="heading">heading</h1>');
+ expect(dom.toString()).toContain('<h2 id="heading2">heading2</h2>');
+ expect(dom.toString()).toContain('<h3>heading3</h3>');
+
+ expect(dom.toString()).toContain('<h1 id="other1">other1</h1>');
+ expect(dom.toString()).toContain('<h2>other2</h2>');
+ });
+
});
});