import { render } from '@testing-library/react';
import TileSet from './TileSet';
describe('The TiledLayer component ', () => {
beforeEach(() => {
globalThis.cacheForTileSet = new Map();
});
test('exposes the tiles needed per its viewport', () => {
const { baseElement } = render(
);
// screen.debug();
expect(baseElement).toMatchInlineSnapshot(`
`);
});
test('adds more tiles when its viewport is updated without removing the previous ones', () => {
const { baseElement, rerender } = render(
);
rerender(
);
// screen.debug();
expect(baseElement).toMatchInlineSnapshot(`
`);
});
test('is not reinitialized if its key isObject updated', () => {
const { baseElement, rerender } = render(
);
rerender(
);
// screen.debug();
expect(baseElement).toMatchInlineSnapshot(`
`);
});
test('Also works with negative coordinates', () => {
const { baseElement } = render(
);
// screen.debug();
expect(baseElement).toMatchInlineSnapshot(`
`);
});
});