Skip to content

Commit

Permalink
Fixing prefixedCSS() tests – wasn’t converting hyphenated formats b…
Browse files Browse the repository at this point in the history
…efore running them through `gimmePrefix()`
  • Loading branch information
stucox committed Mar 4, 2014
1 parent 22a9cac commit 148955e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/js/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,12 @@ function domToCSS (name) {
}).replace(/^ms-/, '-ms-');
}

function cssToDOM( name ) {
return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) {
return m1 + m2.toUpperCase();
}).replace(/^-/, '');
}


test('Modernizr.prefixed() - css and DOM resolving', function(){
var i,
Expand Down Expand Up @@ -712,7 +718,7 @@ test('Modernizr.prefixedCSS', function () {
// Using different properties from Modernizr.prefixed, for the sake of
// variety
function testProp ( prop ) {
var prefixed = gimmePrefix(prop);
var prefixed = gimmePrefix(cssToDOM(prop));
if (prefixed) {
equal(Modernizr.prefixedCSS(prop), domToCSS(prefixed), 'results for ' + prop + ' match the homebaked prefix finder');
}
Expand Down

0 comments on commit 148955e

Please sign in to comment.