mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-16 17:51:07 +00:00
Add tests for setBackgroundImage options parameter
This commit is contained in:
parent
84adc7b4d3
commit
4907861edb
1 changed files with 22 additions and 0 deletions
|
|
@ -1098,6 +1098,28 @@
|
|||
}, 1000);
|
||||
});
|
||||
|
||||
asyncTest('options in setBackgroundImage from URL', function() {
|
||||
canvas.setBackgroundImage(IMG_SRC, function() {
|
||||
equal(canvas.backgroundImage.left, 50);
|
||||
equal(canvas.backgroundImage.originX, 'right');
|
||||
}, {
|
||||
left: 50,
|
||||
originX: 'right'
|
||||
});
|
||||
});
|
||||
|
||||
asyncTest('options in setBackgroundImage from image instance', function() {
|
||||
createImageObject(function(imageInstance) {
|
||||
canvas.setBackgroundImage(imageInstance, function() {
|
||||
equal(canvas.backgroundImage.left, 100);
|
||||
equal(canvas.backgroundImage.originX, 'center');
|
||||
}, {
|
||||
left: 100,
|
||||
originX: 'center'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// asyncTest('backgroundImage', function() {
|
||||
// deepEqual('', canvas.backgroundImage);
|
||||
// canvas.setBackgroundImage('../../assets/pug.jpg');
|
||||
|
|
|
|||
Loading…
Reference in a new issue