mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 21:34:50 +08:00
created new test method, testDataUrl, which makes it super easy to identify data url comparison failures that resulted from Chrome upgrades. Begain integrating. fixed all synchronous unit test data url comparison failures
This commit is contained in:
@@ -55,7 +55,7 @@ Test.Modules.BLOB = {
|
||||
stage.add(layer);
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['blobs'], 'problem with blobs');
|
||||
testDataUrl(layer.toDataURL(), 'blobs', 'problem with blobs');
|
||||
|
||||
test(blob1.getTension() === 0.8, 'blob1 tension should be 0.8');
|
||||
test(blob2.getTension() === 1.2, 'blob2 tension should be 1.2');
|
||||
|
||||
@@ -77,7 +77,7 @@ Test.Modules.SPLINE = {
|
||||
*/
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['curvy lines'], 'problem with curvy lines');
|
||||
testDataUrl(layer.toDataURL(), 'curvy lines', 'problem with curvy lines');
|
||||
|
||||
test(line1.getShapeType() === 'Spline', 'shape type should be Spline');
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ Test.Modules.Text = {
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
|
||||
warn(layer.toDataURL() === dataUrls['multiline text with shadows'], 'multi line text with shadows data url is incorrect');
|
||||
testDataUrl(layer.toDataURL(),'multiline text with shadows', 'multi line text with shadows data url is incorrect');
|
||||
},
|
||||
'change font size should update text data': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -317,7 +317,7 @@ Test.Modules.Text = {
|
||||
stage.add(layer);
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['text everything enabled'], 'should be text with blue fill and red stroke');
|
||||
testDataUrl(layer.toDataURL(), 'text everything enabled', 'should be text with blue fill and red stroke');
|
||||
},
|
||||
'text fill disabled': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -347,7 +347,7 @@ Test.Modules.Text = {
|
||||
stage.add(layer);
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['text fill disabled'], 'should be text with no fill and red stroke');
|
||||
testDataUrl(layer.toDataURL(), 'text fill disabled', 'should be text with no fill and red stroke');
|
||||
},
|
||||
'text stroke disabled': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -377,7 +377,7 @@ Test.Modules.Text = {
|
||||
stage.add(layer);
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['text stroke disabled'], 'should be text with blue fill and no stroke');
|
||||
testDataUrl(layer.toDataURL(),'text stroke disabled', 'should be text with blue fill and no stroke');
|
||||
},
|
||||
'wrapped text': function (containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
@@ -403,15 +403,15 @@ Test.Modules.Text = {
|
||||
layer.add(text);
|
||||
stage.add(layer);
|
||||
|
||||
warn(layer.toDataURL() === dataUrls['wrapped text']['wrapping to words'], 'text should be wrapped to words');
|
||||
testDataUrl(layer.toDataURL(),'wrapping to words', 'text should be wrapped to words');
|
||||
|
||||
text.setWrap('none');
|
||||
layer.draw();
|
||||
warn(layer.toDataURL() === dataUrls['wrapped text']['no wrapping'], 'text should not be wrapped');
|
||||
testDataUrl(layer.toDataURL(),'no wrapping', 'text should not be wrapped');
|
||||
|
||||
text.setWrap('char');
|
||||
layer.draw();
|
||||
warn(layer.toDataURL() === dataUrls['wrapped text']['wrapping to chars'], 'text should be wrapped to chars');
|
||||
testDataUrl(layer.toDataURL(), 'wrapping to chars', 'text should be wrapped to chars');
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ Test.Modules.Wedge = {
|
||||
stage.add(layer);
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['wedge'], 'problem rendering wedge');
|
||||
testDataUrl(layer.toDataURL(), 'wedge', 'problem rendering wedge');
|
||||
|
||||
test(wedge.getShapeType() === 'Wedge', 'shape type should be Wedge');
|
||||
},
|
||||
@@ -77,6 +77,6 @@ Test.Modules.Wedge = {
|
||||
layer.draw();
|
||||
|
||||
//console.log(layer.toDataURL());
|
||||
warn(layer.toDataURL() === dataUrls['rotate wedge'], 'problem with rotated wedge rendering');
|
||||
testDataUrl(layer.toDataURL(), 'rotate wedge', 'problem with rotated wedge rendering');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user