Skip to content

Commit 208c347

Browse files
committed
fix: fix vt spec
1 parent ba30bc1 commit 208c347

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

packages/vt/test/specs/update.spec.js

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,32 +1678,20 @@ describe('update style specs', () => {
16781678
const groupLayer = new GroupGLLayer('group', [
16791679
layer
16801680
], { sceneConfig });
1681-
let painted = false;
1682-
let finished = false;
1683-
let count = 0;
1684-
map.on('renderend', () => {
1681+
groupLayer.addTo(map);
1682+
setTimeout(() => {
16851683
const canvas = groupLayer.getRenderer().canvas;
16861684
const pixel = readPixel(canvas, canvas.width / 2 + 40, canvas.height / 2);
1687-
if (pixel[0] > 0) {
1688-
1689-
if (!painted) {
1690-
assert.deepEqual(pixel, [78, 78, 78, 255]);
1691-
1692-
material.baseColorTexture = 'file://' + path.resolve(__dirname, '../integration/resources/1.png');
1693-
layer.updateSymbol(0, { material });
1694-
painted = true;
1695-
} else if (!finished) {
1696-
count++;
1697-
if (count >= 8) {
1698-
finished = true;
1699-
assert.deepEqual(pixel, [36, 40, 44, 255]);
1700-
done();
1701-
}
1702-
}
1703-
}
1704-
});
1705-
groupLayer.addTo(map);
1706-
}).timeout(3000);
1685+
assert.deepEqual(pixel, [78, 78, 78, 255]);
1686+
material.baseColorTexture = 'file://' + path.resolve(__dirname, '../integration/resources/1.png');
1687+
layer.updateSymbol(0, { material });
1688+
setTimeout(() => {
1689+
const pixel = readPixel(canvas, canvas.width / 2 + 40, canvas.height / 2);
1690+
assert.deepEqual(pixel, [36, 40, 44, 255]);
1691+
done();
1692+
}, 1500);
1693+
}, 1500);
1694+
}).timeout(5000);
17071695

17081696
it('should can update symbol to lit with AA, maptalks-studio#374', done => {
17091697
//https://github.com/fuzhenn/maptalks-studio/issues/374

0 commit comments

Comments
 (0)