Skip to content

Commit

Permalink
Test to back up 6077274
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Jul 11, 2014
1 parent 6077274 commit 40486a0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@
});

test("getWidthFromLength", function() {
equal(pf.getWidthFromLength("750px"), 750, "returns int value of width string");
var calcTest = (function() {
var fullWidthEl = document.createElement( "div" );
document.documentElement.insertBefore( fullWidthEl, document.documentElement.firstChild );

var gotWidth = pf.getWidthFromLength("calc(766px - 1em)");

return ( gotWidth === 750 || gotWidth === fullWidthEl.offsetWidth );
}());

equal( pf.getWidthFromLength("750px"), 750, "returns int value of width string" );
ok( calcTest, "If `calc` is supported, `calc(766px - 1em)` returned `750px`. If `calc` is unsupported, the value was discarded and defaulted to `100vw`.");
});

test("findWidthFromSourceSize", function() {
Expand Down

0 comments on commit 40486a0

Please sign in to comment.