update depedencies, changes to support updated authentication-module
[squeep-indie-auther] / test / src / template / template-helper.js
index 7903dd88d86672eeb4918f2d3322e01e6bf3f035..a40293eb1354c21d4eb33f3a012c6b3714cb42c7 100644 (file)
@@ -92,4 +92,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