fix changelog
[squeep-indie-auther] / test / src / template / template-helper.js
index 7903dd88d86672eeb4918f2d3322e01e6bf3f035..ca61f34544f2053ee2a60bd20f64e177466e489f 100644 (file)
@@ -1,4 +1,3 @@
-/* eslint-env mocha */
 'use strict';
 
 const assert = require('assert');
@@ -92,4 +91,34 @@ describe('Template Helper', function () {
     });
   }); // scopeCompare
 
+  describe('navLinks', function () {
+    let pagePathLevel, ctx, options;
+    beforeEach(function () {
+      pagePathLevel = 1;
+      ctx = {};
+      options = {
+        navLinks: [],
+      };
+    });
+    it('populates navLinks', function () {
+      th.navLinks(pagePathLevel, ctx, options);
+      assert.strictEqual(options.navLinks.length, 2);
+    });
+    it('creates and populates navLinks', function () {
+      delete options.navLinks;
+      th.navLinks(pagePathLevel, ctx, options);
+      assert.strictEqual(options.navLinks.length, 2);
+    });
+    it('populates navLink when on admin', function () {
+      options.pageIdentifier = 'admin';
+      th.navLinks(pagePathLevel, ctx, options);
+      assert.strictEqual(options.navLinks.length, 1);
+    });
+    it('populates navLink when on ticketProffer', function () {
+      options.pageIdentifier = 'ticketProffer';
+      th.navLinks(pagePathLevel, ctx, options);
+      assert.strictEqual(options.navLinks.length, 1);
+    });
+  }); // navLinks
+
 }); // Template Helper