hmpo-template-mixins
Advanced tools
Comparing version 2.0.0-1 to 2.0.0
@@ -158,3 +158,4 @@ 'use strict'; | ||
label: t(fieldLabel || 'fields.' + key + '.label'), | ||
selected: selected | ||
selected: selected, | ||
className: classNames(key) || 'block-label' | ||
}); | ||
@@ -161,0 +162,0 @@ } |
{ | ||
"name": "hmpo-template-mixins", | ||
"version": "2.0.0-1", | ||
"version": "2.0.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", |
@@ -36,3 +36,3 @@ # passports-template-mixins | ||
By default any function set to `req.translate` will be used for translation if it exists. For example, that generate using [i18n-future](https://npmjs.com/package.i18n-future) middleware. | ||
By default any function set to `req.translate` will be used for translation if it exists. For example, that generated using [i18n-future](https://npmjs.com/package/i18n-future) middleware. | ||
@@ -39,0 +39,0 @@ ## Options |
@@ -397,2 +397,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({ | ||
'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' | ||
})); | ||
}); | ||
}); | ||
@@ -399,0 +420,0 @@ |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
44196
802
0