From 9fa7ea912490c1939b5d3e949ebd19730d28cb00 Mon Sep 17 00:00:00 2001 From: Remi Planel Date: Wed, 29 May 2019 18:33:27 +0200 Subject: [PATCH] Add test on genome browser width --- tests/selected-chromosome.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/selected-chromosome.test.ts b/tests/selected-chromosome.test.ts index f4bd22b..66a086a 100644 --- a/tests/selected-chromosome.test.ts +++ b/tests/selected-chromosome.test.ts @@ -33,13 +33,17 @@ describe("Test Selected Chromosome", () => { '
'; const container = select("svg") .select("g"); - + const width = 1500; container .datum(data) - .call(selectedChromosomeComponent, 1500); + .call(selectedChromosomeComponent, width); // Start tests test("Test data to DOM elements", () => { expect(container.html()).toBe(result); }) + test("Width background rectangle", () => { + const displayWidth = parseInt(container.select(".genome-browser-background").attr("width")); + expect(displayWidth).toBe(width); + }) }) \ No newline at end of file -- GitLab