You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

hmpo-template-mixins

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hmpo-template-mixins - npm Package Compare versions

Comparing version

to
1.1.0

3

lib/template-mixins.js

@@ -148,3 +148,4 @@ 'use strict';

label: t(fieldLabel || sharedTranslationsKey + 'fields.' + key + '.label'),
selected: selected
selected: selected,
className: classNames(key) || 'block-label'
});

@@ -151,0 +152,0 @@ }

{
"name": "hmpo-template-mixins",
"version": "1.0.0",
"version": "1.1.0",
"description": "A middleware that exposes a series of Mustache mixins on res.locals to ease usage of forms, translations, and some general needs.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -367,2 +367,23 @@ var mixins = require('../lib/template-mixins');

it('should default className `block-label`', function () {
middleware(req, res, next);
res.locals['checkbox']().call(res.locals, 'field-name');
render.should.have.been.calledWith(sinon.match({
className: 'block-label'
}));
});
it('should override default className if one was specified against the field', function () {
middleware = mixins(translate, {
'field-name': {
'className': 'overwritten'
}
});
middleware(req, res, next);
res.locals['checkbox']().call(res.locals, 'field-name');
render.should.have.been.calledWith(sinon.match({
className: 'overwritten'
}));
});
});

@@ -369,0 +390,0 @@

Sorry, the diff of this file is not supported yet