Add test for transform toString

This commit is contained in:
Maximilian Krög
2021-05-18 09:36:03 +02:00
parent f66fc99bd8
commit 0486caf659
+9
View File
@@ -11,6 +11,7 @@ import {
scale, scale,
set, set,
setFromArray, setFromArray,
toString,
translate, translate,
} from '../../../../src/ol/transform.js'; } from '../../../../src/ol/transform.js';
@@ -177,4 +178,12 @@ describe('ol.transform', function () {
expect(point).to.eql([3, 5]); expect(point).to.eql([3, 5]);
}); });
}); });
describe('toString()', function () {
it('compares with value read back from node', function () {
const mat = [1 / 3, 0, 0, 1 / 3, 0, 0];
const node = document.createElement('div');
node.style.transform = 'matrix(' + mat.join(',') + ')';
expect(toString(mat)).to.be(node.style.transform);
});
});
}); });