X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=test%2Fsrc%2Ftemplate%2Ftemplate-helper.js;fp=test%2Fsrc%2Ftemplate%2Ftemplate-helper.js;h=a40293eb1354c21d4eb33f3a012c6b3714cb42c7;hp=7903dd88d86672eeb4918f2d3322e01e6bf3f035;hb=fba42a499fe1af051b0982c1f3e8b3873c9ed2fb;hpb=e8dccf76ec2776f07eddd1ce2f1c4fc150a6f790 diff --git a/test/src/template/template-helper.js b/test/src/template/template-helper.js index 7903dd8..a40293e 100644 --- a/test/src/template/template-helper.js +++ b/test/src/template/template-helper.js @@ -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