Skip to content

Commit 8bc3ae3

Browse files
committed
Fix max texture size tests
1 parent b4a3a71 commit 8bc3ae3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/unit/core/rendering.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,23 @@ suite('Rendering', function() {
101101
assert.equal(fbo.height, 15);
102102
});
103103

104-
// NOTE: below two are nearly identical, should be checked
105-
test('should resize the dimensions of canvas based on max texture size', function() {
104+
test('should limit dimensions of canvas based on max texture size on create', function() {
106105
glStub = vi.spyOn(p5.RendererGL.prototype, '_getMaxTextureSize');
107106
const fakeMaxTextureSize = 100;
108107
glStub.mockReturnValue(fakeMaxTextureSize);
109108
myp5.createCanvas(10, 10, myp5.WEBGL);
109+
myp5.pixelDensity(1);
110110
myp5.resizeCanvas(200, 200);
111111
assert.equal(myp5.width, 100);
112112
assert.equal(myp5.height, 100);
113113
});
114114

115-
test.todo('should resize the dimensions of canvas based on max texture size', function() {
115+
test('should limit dimensions of canvas based on max texture size on resize', function() {
116116
glStub = vi.spyOn(p5.RendererGL.prototype, '_getMaxTextureSize');
117117
const fakeMaxTextureSize = 100;
118118
glStub.mockReturnValue(fakeMaxTextureSize);
119119
myp5.createCanvas(200, 200, myp5.WEBGL);
120+
myp5.pixelDensity(1);
120121
assert.equal(myp5.width, 100);
121122
assert.equal(myp5.height, 100);
122123
});

0 commit comments

Comments
 (0)