From 7c916e399b9fe736c05c2b3056773fc780601e2f Mon Sep 17 00:00:00 2001 From: Iuliia Kulagina Date: Fri, 8 Sep 2023 13:45:56 +0200 Subject: [PATCH] Fix lint and test errors --- src/sankeyDiagram.ts | 8 +++----- test/visualTest.ts | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/sankeyDiagram.ts b/src/sankeyDiagram.ts index f1d5cc9..5768e10 100644 --- a/src/sankeyDiagram.ts +++ b/src/sankeyDiagram.ts @@ -1923,13 +1923,11 @@ export class SankeyDiagram implements IVisual { const linkKneeSize: number = Math.min(link.destination.width, minHeight); - let x0: number, - x1: number, - y0: number, + let y0: number, y1: number; - x0 = link.source.x + link.source.width / 2; - x1 = link.destination.x; + const x0 = link.source.x + link.source.width / 2; + const x1 = link.destination.x; // drawing area as combination of 4 lines in one path element of svg to fill this area with required color diff --git a/test/visualTest.ts b/test/visualTest.ts index 57e3359..3c7548d 100644 --- a/test/visualTest.ts +++ b/test/visualTest.ts @@ -811,7 +811,7 @@ describe("SankeyDiagram", () => { const defaultWaitForRender: number = 500; describe("Keyboard Navigation check", () =>{ - it("links should have attributes tabindex=0, role=option, aria-label is not null, and aria-selected=false", (done) => { + it("links should have attributes tabindex>0, role=option, aria-label is not null, and aria-selected=false", (done) => { visualBuilder.updateRenderTimeout(dataView, () => { // defaults const someColor: string = "#000000"; @@ -823,7 +823,7 @@ describe("SankeyDiagram", () => { let nodes = visualBuilder.linkElements; nodes.forEach((el: Element) => { expect(el.getAttribute("role")).toBe("option"); - expect(el.getAttribute("tabindex")).toBe("0"); + expect(el.getAttribute("tabindex")).toBeGreaterThanOrEqual(1); expect(el.getAttribute("aria-selected")).toBe("false"); expect(el.getAttribute("aria-label")).not.toBeNull(); });