Guard native player health resolution
This commit is contained in:
parent
ea12250556
commit
1e05b407a0
@ -93,12 +93,16 @@ const webpDimensions = (name, dataUrl) => {
|
|||||||
assert.fail(`${name} must expose VP8X dimensions`);
|
assert.fail(`${name} must expose VP8X dimensions`);
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const [name, dataUrl] of Object.entries({ playerHealth, enemyHealth })) {
|
test('playerHealth native frame stays high resolution', () => {
|
||||||
test(`${name} health sheet stays high resolution`, () => {
|
const { width, height } = webpDimensions('playerHealth', playerHealth);
|
||||||
const { width, height } = webpDimensions(name, dataUrl);
|
assert.ok(width >= 300, `playerHealth width must stay >= 300px, got ${width}px`);
|
||||||
assert.ok(width >= 1200, `${name} width must stay >= 1200px, got ${width}px`);
|
assert.ok(height >= 100, `playerHealth height must stay >= 100px, got ${height}px`);
|
||||||
assert.ok(height >= 300, `${name} height must stay >= 300px, got ${height}px`);
|
});
|
||||||
assert.ok(width / 4 >= 300, `${name} frame width must stay >= 300px`);
|
|
||||||
assert.ok(height / 3 >= 100, `${name} frame height must stay >= 100px`);
|
test('enemyHealth health sheet stays high resolution', () => {
|
||||||
|
const { width, height } = webpDimensions('enemyHealth', enemyHealth);
|
||||||
|
assert.ok(width >= 1200, `enemyHealth width must stay >= 1200px, got ${width}px`);
|
||||||
|
assert.ok(height >= 300, `enemyHealth height must stay >= 300px, got ${height}px`);
|
||||||
|
assert.ok(width / 4 >= 300, 'enemyHealth frame width must stay >= 300px');
|
||||||
|
assert.ok(height / 3 >= 100, 'enemyHealth frame height must stay >= 100px');
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user