mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix #689 - add unit test for v0 deserializer
This commit is contained in:
parent
14e969a3bb
commit
8f4f9d9b0a
25
test/js/utils/serialization/Deserializer_v0Test.js
Normal file
25
test/js/utils/serialization/Deserializer_v0Test.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
describe("Deserializer v0 test", function() {
|
||||||
|
|
||||||
|
var black = '#000000';
|
||||||
|
var transparent = Constants.TRANSPARENT_COLOR;
|
||||||
|
var data = [
|
||||||
|
[
|
||||||
|
["#000000", "TRANSPARENT"],
|
||||||
|
["TRANSPARENT", "#000000"]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
it("deserializes data serialized for model v0 correctly", function (done) {
|
||||||
|
var deserializer = pskl.utils.serialization.Deserializer;
|
||||||
|
deserializer.deserialize(data, function (p) {
|
||||||
|
// Check the frame has been properly deserialized
|
||||||
|
expect(p.getLayerAt(0).getFrames().length).toBe(1);
|
||||||
|
var frame = p.getLayerAt(0).getFrameAt(0);
|
||||||
|
test.testutils.frameEqualsGrid(frame, [
|
||||||
|
[black, transparent],
|
||||||
|
[transparent, black]
|
||||||
|
]);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user