mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 19:07:59 +08:00
cleaned up functional test data urls. Functional tests now pass with no warnings
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,7 +1,5 @@
|
|||||||
Test.Modules.DD = {
|
Test.Modules.DD = {
|
||||||
'test dragstart, dragmove, dragend': function(containerId) {
|
'test dragstart, dragmove, dragend': function(containerId) {
|
||||||
var urls = dataUrls['DRAG AND DROP - test dragstart, dragmove, dragend'];
|
|
||||||
|
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
width: 578,
|
width: 578,
|
||||||
@@ -40,8 +38,8 @@ Test.Modules.DD = {
|
|||||||
circle.on('dragend', function() {
|
circle.on('dragend', function() {
|
||||||
dragEnd = true;
|
dragEnd = true;
|
||||||
});
|
});
|
||||||
startDataUrl = layer.toDataURL();
|
|
||||||
warn(urls[0] === startDataUrl, 'start data url is incorrect');
|
warn(layer.toDataURL() === dataUrls['drag circle before'], 'start data url is incorrect');
|
||||||
/*
|
/*
|
||||||
* simulate drag and drop
|
* simulate drag and drop
|
||||||
*/
|
*/
|
||||||
@@ -73,8 +71,7 @@ Test.Modules.DD = {
|
|||||||
test(dragMove, 'dragmove event was not triggered');
|
test(dragMove, 'dragmove event was not triggered');
|
||||||
test(dragEnd, 'dragend event was not triggered');
|
test(dragEnd, 'dragend event was not triggered');
|
||||||
|
|
||||||
var endDataUrl = layer.toDataURL();
|
warn(layer.toDataURL() === dataUrls['drag circle after'], 'end data url is incorrect');
|
||||||
warn(urls[1] === endDataUrl, 'end data url is incorrect');
|
|
||||||
},
|
},
|
||||||
'cancel drag and drop by setting draggable to false': function(containerId) {
|
'cancel drag and drop by setting draggable to false': function(containerId) {
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
@@ -141,7 +138,6 @@ Test.Modules.DD = {
|
|||||||
test(circle.getPosition().y === 100, 'circle y should be 100');
|
test(circle.getPosition().y === 100, 'circle y should be 100');
|
||||||
},
|
},
|
||||||
'drag and drop layer': function(containerId) {
|
'drag and drop layer': function(containerId) {
|
||||||
var urls = dataUrls['DRAG AND DROP - drag and drop layer'];
|
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
width: 578,
|
width: 578,
|
||||||
@@ -183,8 +179,8 @@ Test.Modules.DD = {
|
|||||||
|
|
||||||
var top = stage.content.getBoundingClientRect().top;
|
var top = stage.content.getBoundingClientRect().top;
|
||||||
|
|
||||||
var startDataUrl = layer.toDataURL();
|
//console.log(layer.toDataURL())
|
||||||
warn(urls[0] === startDataUrl, 'start data url is incorrect');
|
warn(layer.toDataURL() === dataUrls['drag layer before'], 'start data url is incorrect');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* simulate drag and drop
|
* simulate drag and drop
|
||||||
@@ -203,16 +199,14 @@ Test.Modules.DD = {
|
|||||||
clientX: 210,
|
clientX: 210,
|
||||||
clientY: 109 + top
|
clientY: 109 + top
|
||||||
});
|
});
|
||||||
|
//console.log(layer.toDataURL())
|
||||||
var endDataUrl = layer.toDataURL()
|
warn(layer.toDataURL() === dataUrls['drag layer after'], 'end data url is incorrect');
|
||||||
warn(urls[1] === endDataUrl, 'end data url is incorrect');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Test.Modules.EVENT = {
|
Test.Modules.EVENT = {
|
||||||
'modify fill stroke and stroke width on hover with circle': function(containerId) {
|
'modify fill stroke and stroke width on hover with circle': function(containerId) {
|
||||||
var urls = dataUrls['EVENTS - modify fill stroke and stroke width on hover with circle'];
|
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
width: 578,
|
width: 578,
|
||||||
@@ -252,14 +246,14 @@ Test.Modules.EVENT = {
|
|||||||
|
|
||||||
var top = stage.content.getBoundingClientRect().top;
|
var top = stage.content.getBoundingClientRect().top;
|
||||||
|
|
||||||
warn(layer.toDataURL() === urls[0], 'start data url is incorrect');
|
warn(layer.toDataURL() === dataUrls['modify fill and stroke before'], 'start data url is incorrect');
|
||||||
|
|
||||||
stage._mousemove({
|
stage._mousemove({
|
||||||
clientX: 377,
|
clientX: 377,
|
||||||
clientY: 101 + top
|
clientY: 101 + top
|
||||||
});
|
});
|
||||||
|
|
||||||
warn(layer.toDataURL() === urls[1], 'mid data url is incorrect');
|
warn(layer.toDataURL() === dataUrls['modify fill and stroke after'], 'mid data url is incorrect');
|
||||||
|
|
||||||
// move mouse back out of circle
|
// move mouse back out of circle
|
||||||
stage._mousemove({
|
stage._mousemove({
|
||||||
@@ -271,7 +265,7 @@ Test.Modules.EVENT = {
|
|||||||
clientY: 138 + top
|
clientY: 138 + top
|
||||||
});
|
});
|
||||||
|
|
||||||
warn(layer.toDataURL() === urls[0], 'end data url is incorrect');
|
warn(layer.toDataURL() === dataUrls['modify fill and stroke before'], 'end data url is incorrect');
|
||||||
},
|
},
|
||||||
'mousedown mouseup mouseover mouseout mousemove click dblclick / touchstart touchend touchmove tap dbltap': function(containerId) {
|
'mousedown mouseup mouseover mouseout mousemove click dblclick / touchstart touchend touchmove tap dbltap': function(containerId) {
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
|
Reference in New Issue
Block a user