diff --git a/packages/nightingale-interpro-track/tests/nightingale-interpro-track.test.js b/packages/nightingale-interpro-track/tests/nightingale-interpro-track.test.js
index b060484a..09565c92 100644
--- a/packages/nightingale-interpro-track/tests/nightingale-interpro-track.test.js
+++ b/packages/nightingale-interpro-track/tests/nightingale-interpro-track.test.js
@@ -20,7 +20,7 @@ describe("nightingale-interpro-track tests", () => {
document.querySelector("nightingale-interpro-track").remove();
});
- test("it should show nightingale-interpro-track and the current number of residue features coverage mask rects and no highlight", async () => {
+ test("it should show nightingale-interpro-track and the current number of residue features coverage mask rects and no highlight", () => {
expect(document.querySelector("nightingale-interpro-track")).toBeDefined();
expect(
document.querySelectorAll("path.feature.rectangle.residue").length
diff --git a/packages/nightingale-track/tests/__snapshots__/nightingale-track.test.js.snap b/packages/nightingale-track/tests/__snapshots__/nightingale-track.test.js.snap
deleted file mode 100644
index bf5d8e1c..00000000
--- a/packages/nightingale-track/tests/__snapshots__/nightingale-track.test.js.snap
+++ /dev/null
@@ -1,3992 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`nightingale-track tests it should change the layout 1`] = `
-
-
-
-
-`;
-
-exports[`nightingale-track tests it should display the sequence correctly after highlight 1`] = `
-
-
-
-
-`;
-
-exports[`nightingale-track tests it should display the track correctly 1`] = `
-
-
-
-
-`;
-
-exports[`nightingale-track tests it should zoom in 1`] = `
-
-
-
-
-`;
diff --git a/packages/nightingale-track/tests/nightingale-track.test.js b/packages/nightingale-track/tests/nightingale-track.test.js
index 12585a04..9721c6d4 100644
--- a/packages/nightingale-track/tests/nightingale-track.test.js
+++ b/packages/nightingale-track/tests/nightingale-track.test.js
@@ -16,31 +16,44 @@ describe("nightingale-track tests", () => {
document.querySelector("nightingale-track").remove();
});
- test("it should display the track correctly", async () => {
- expect(rendered).toMatchSnapshot();
+ test("it should display the track correctly with no highlight and no margin rects", () => {
+ expect(document.querySelector("nightingale-track")).toBeDefined();
+ expect(document.querySelectorAll("rect").length).toBe(34);
+ expect(document.querySelector("g.highlighted>rect")).toBeFalsy();
+ expect(document.querySelector("rect.margin-left")).toBeFalsy();
+ expect(document.querySelector("rect.margin-right")).toBeFalsy();
+ expect(document.querySelector("rect.margin-top")).toBeFalsy();
+ expect(document.querySelector("rect.margin-bottom")).toBeFalsy();
});
- test("it should zoom in", (done) => {
+ test("it should zoom in with correct number of rects and with no highlight", (done) => {
rendered.setAttribute("display-start", "2");
rendered.setAttribute("display-end", "4");
window.requestAnimationFrame(() => {
- expect(rendered).toMatchSnapshot();
+ expect(document.querySelector("nightingale-track")).toBeDefined();
+ expect(document.querySelectorAll("rect").length).toBe(38);
+ expect(document.querySelector("g.highlighted>rect")).toBeFalsy();
done();
});
});
- test("it should change the layout", (done) => {
+ test("it should change the layout with margins and have no highlight", (done) => {
rendered.setAttribute("layout", "non-overlapping");
window.requestAnimationFrame(() => {
- expect(rendered).toMatchSnapshot();
+ expect(document.querySelector("nightingale-track")).toBeDefined();
+ expect(document.querySelector("rect.margin-left")).toBeDefined();
+ expect(document.querySelector("rect.margin-right")).toBeDefined();
+ expect(document.querySelector("rect.margin-top")).toBeDefined();
+ expect(document.querySelector("rect.margin-bottom")).toBeDefined();
+ expect(document.querySelector("g.highlighted>rect")).toBeFalsy();
done();
});
});
- test("it should display the sequence correctly after highlight", (done) => {
+ test("it should display display highlight after being set", (done) => {
rendered.setAttribute("highlight", "10:30");
window.requestAnimationFrame(() => {
- expect(rendered).toMatchSnapshot();
+ expect(document.querySelector("g.highlighted>rect")).toBeTruthy();
done();
});
});