From 90e2c833a29f33adf21089eb0b66b90cb5367a58 Mon Sep 17 00:00:00 2001 From: evlist Date: Tue, 18 Oct 2022 11:44:50 +0200 Subject: [PATCH] Adding some tests for --- src/components/map/Handlers.test.tsx | 152 +++++++++++++++++++++++++-- src/components/map/Handlers.tsx | 39 +++---- src/components/map/Tile.test.tsx | 4 +- 3 files changed, 164 insertions(+), 31 deletions(-) diff --git a/src/components/map/Handlers.test.tsx b/src/components/map/Handlers.test.tsx index 0d0a31e..343aa2f 100644 --- a/src/components/map/Handlers.test.tsx +++ b/src/components/map/Handlers.test.tsx @@ -1,23 +1,153 @@ -import { render, screen } from '@testing-library/react'; +import { createEvent, fireEvent, render, screen } from '@testing-library/react'; import { Handlers } from './Handlers'; import { Point } from './types'; describe('The Handlers component ', () => { - test('Is just an empty div', () => { + test('is just an empty div', () => { const transformMap = ( deltaShift: Point | null, deltaZoom: number | null, zoomCenter: Point | null ) => {}; - const { baseElement } = render(); + render(); // screen.debug(); - expect(baseElement).toMatchInlineSnapshot(` - -
-
-
- + const handlers = screen.getByRole('presentation'); + // screen.debug(); + expect(handlers).toMatchInlineSnapshot(` +