0898014ebd
In 4.0.20 all tests were reworked. The 'testrunner' was removed and the PhantomJS Runner QUnit plugin was added making it possible to run the tests from cli. However it is still necessary to run the tests in all supported browsers to test the fixes for all browser quirks and normalization. Also all tests are loaded in one html file. See #27014 git-svn-id: https://develop.svn.wordpress.org/trunk@27679 602fd350-edb4-49c9-b593-d223f7449a82
57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
(function() {
|
|
var panel;
|
|
|
|
module("tinymce.ui.FitLayout", {
|
|
setup: function() {
|
|
document.getElementById('view').innerHTML = '';
|
|
},
|
|
|
|
teardown: function() {
|
|
tinymce.dom.Event.clean(document.getElementById('view'));
|
|
}
|
|
});
|
|
|
|
function createFitPanel(settings) {
|
|
return tinymce.ui.Factory.create(tinymce.extend({
|
|
type: 'panel',
|
|
layout: 'fit',
|
|
width: 200,
|
|
height: 200,
|
|
border: 1
|
|
}, settings)).renderTo(document.getElementById('view')).reflow();
|
|
}
|
|
|
|
test("fit with spacer inside", function() {
|
|
panel = createFitPanel({
|
|
items: [
|
|
{type: 'spacer', classes: 'red'}
|
|
]
|
|
});
|
|
|
|
deepEqual(Utils.rect(panel), [0, 0, 200, 200]);
|
|
deepEqual(Utils.rect(panel.find('spacer')[0]), [1, 1, 198, 198]);
|
|
});
|
|
|
|
test("fit with padding and spacer inside", function() {
|
|
panel = createFitPanel({
|
|
padding: 3,
|
|
items: [
|
|
{type: 'spacer', classes: 'red'}
|
|
]
|
|
});
|
|
|
|
deepEqual(Utils.rect(panel), [0, 0, 200, 200]);
|
|
deepEqual(Utils.rect(panel.find('spacer')[0]), [4, 4, 192, 192]);
|
|
});
|
|
|
|
test("fit with panel inside", function() {
|
|
panel = createFitPanel({
|
|
items: [
|
|
{type: 'panel', border: 1}
|
|
]
|
|
});
|
|
|
|
deepEqual(Utils.rect(panel), [0, 0, 200, 200]);
|
|
deepEqual(Utils.rect(panel.find('panel')[0]), [1, 1, 198, 198]);
|
|
});
|
|
})(); |