Skip to content

Commit

Permalink
Add a couple of basic sanity tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Campi committed Aug 31, 2012
1 parent dee2985 commit d43b12e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ $(function () {
}
});

test('Construction', function () {
test('grid: lineHeight', function () {
var e = $('<p></p>').addClass('testonly').appendTo('body').css({
fontSize: '14px',
lineHeight: '1.45em'
}),
p = new treesaver.layout.Content(e[0]);

equals(p.lineHeight, treesaver.capabilities.SUPPORTS_SUBPIXELS? 21: 20, 'lineHeight is rounded correctly');
});
});
8 changes: 8 additions & 0 deletions test/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ $(function () {
ok(!twocol_grid.error, 'Empty grid: No error');
});

test('grid: Grid subpixel line height', function () {
var $two = $('.grids .twocontainer').css({"font-size": "13px", "line-height": "1.375em"}),
twocol_grid = new treesaver.layout.Grid($two[0]);

ok(!!twocol_grid, 'Empty grid: Created');
equal(twocol_grid.lineHeight, treesaver.capabilities.SUPPORTS_SUBPIXELS? 18: 17, 'lineHeight is rounded correctly');
});

test('grid: Stretching', function () {
var $fiver = $('.grids .fiver'),
fiver_grid = new treesaver.layout.Grid($fiver[0]);
Expand Down

0 comments on commit d43b12e

Please sign in to comment.