Skip to content

Commit 7a0608f

Browse files
committed
Expand background image tests
1 parent 753efb7 commit 7a0608f

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

tests/index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,21 @@ test('set({ backgroundImage })', async (t) => {
204204
const regl = createRegl(canvas);
205205
const scatterplot = createScatterplot({ canvas, regl });
206206

207-
const backgroundImage = await createTextureFromUrl(
207+
let backgroundImage = await createTextureFromUrl(
208208
regl,
209-
'https://picsum.photos/300/200/',
210-
true
209+
'https://picsum.photos/300/200/'
210+
);
211+
212+
scatterplot.set({ backgroundImage });
213+
214+
t.equal(
215+
scatterplot.get('backgroundImage'),
216+
backgroundImage,
217+
'background image should be a Regl texture'
218+
);
219+
220+
backgroundImage = await scatterplot.createTextureFromUrl(
221+
'https://picsum.photos/300/200/'
211222
);
212223

213224
scatterplot.set({ backgroundImage });
@@ -235,7 +246,7 @@ test('set({ backgroundImage })', async (t) => {
235246
t.equal(
236247
scatterplot.get('backgroundImage').width,
237248
300,
238-
'background image should be a Regl texture'
249+
'background image should be loaded by scatterplot'
239250
);
240251
});
241252

0 commit comments

Comments
 (0)