From 6090f9aab50d07185b46df492109ff96fa1c908c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Mon, 28 Aug 2023 18:23:59 +0400 Subject: [PATCH] Test getSpots by id --- test/specs/canvas/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/specs/canvas/index.ts b/test/specs/canvas/index.ts index e1eb023a1..cb998f382 100644 --- a/test/specs/canvas/index.ts +++ b/test/specs/canvas/index.ts @@ -68,6 +68,16 @@ describe('Canvas', () => { expect(spotsSelect.length).toBe(1); expect(spotsTarget.length).toBe(2); }); + + test('Get spot by id', () => { + canvas.addSpot({ type: Select }); + canvas.addSpot({ type: Target }); + const spotT2 = canvas.addSpot({ id: 'target2', type: Target }); + + const spotsTarget = canvas.getSpots({ id: 'target2', type: Select }); + expect(spotsTarget.length).toBe(1); + expect(spotsTarget[0]).toBe(spotT2); + }); }); describe('Spot Events', () => {