Skip to content

Commit

Permalink
Merge pull request #882 from opencb/TASK-5827
Browse files Browse the repository at this point in the history
TASK-5827 - Port Patch 1.10.3 -> 2.1.0
  • Loading branch information
gpveronica authored Mar 19, 2024
2 parents 343c97f + 358ab7b commit 4e9dd48
Show file tree
Hide file tree
Showing 60 changed files with 6,122 additions and 1,926 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/iva/custom-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import UtilsTest from "../../support/utils-test.js";

context("Sample Browser Grid", () => {
context("Custom page", () => {

beforeEach(() => {
cy.visit("#aboutzetta");
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/iva/individual-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ context("Individual Browser Grid", () => {
.find("span.select2-selection__rendered")
.should("contain.text", "Glioblastoma multiforme");
cy.get("@modal-create")
.find(`input[placeholder="Add phenotype ID......"]`)
.find(`input[placeholder="Add phenotype ID..."]`)
.then(element => {
expect(element.val()).equal("HP:0012174");
cy.wrap(element).should("be.disabled");
Expand Down
144 changes: 49 additions & 95 deletions cypress/e2e/iva/variant-browser-grid-cancer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ context("Variant Browser Grid Cancer", () => {

beforeEach(() => {
cy.visit("#variant-browser-grid-cancer");
cy.get(`div[data-cy="variant-browser-container"]`)
.as("container");
cy.waitUntil(() => {
return cy.get(browserGrid)
return cy.get("@container")
.should("be.visible");
});
});
Expand Down Expand Up @@ -116,119 +118,71 @@ context("Variant Browser Grid Cancer", () => {
.should("be.visible");
});

it("should chnage page variant-browser-grid", () => {
it("should change page variant-browser-grid", () => {
UtilsTest.changePage(browserGrid,2);
UtilsTest.changePage(browserGrid,3);
});
});

context("Tooltip", () => {
it("should display variant tooltip", () => {
// Select first row, first column: Variant
// variant == id
BrowserTest.getColumnIndexByHeader("Variant");
cy.get("@indexColumn")
.then(index => {
cy.get("tbody tr:first > td")
.eq(index)
.within(() => {
cy.get("a")
.eq(0)
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});
context("Variant Browser Bootstrap Grid", () => {

beforeEach(() => {
cy.get("@container")
.find(`div[data-cy="vb-grid"]`)
.as("grid");
});

it("should display gene tooltip", () => {
BrowserTest.getColumnIndexByHeader("Gene");
cy.get("@indexColumn")
.then(index => {
cy.get("tbody tr:first > td")
.eq(index)
.within(() => {
cy.get("a")
.eq(0)
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
context("Tooltip", () => {

const tooltips = [
{title: "Variant", },
{title: "Gene"},
{title: "Consequence Type"},
];
const helps = [
{title: "Deleteriousness"},
{title: "Conservation"},
{title: "Population Frequencies"},
{title: "Clinical Info"},
];

beforeEach(() => {
cy.get("@grid")
.find("tbody")
.as("body");
});
});

it("should display consequenceType tooltip", () => {
BrowserTest.getColumnIndexByHeader("Consequence Type");
cy.get("@indexColumn")
.then(index => {
cy.get("tbody tr:first > td")
.eq(index)
it("should display headers' help", () => {
// Select first row, first column: Variant
// variant == id
cy.wrap(helps).each(help => {
cy.get("@grid")
.contains("th", help.title)
.within(() => {
cy.get("a")
.eq(0)
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});
});

it("should display population frequencies tooltip", () => {
cy.get("tbody tr:first > td")
.eq(13)
.within(() => {
cy.get("a")
.eq(0)
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});
});

context("Helpers", () => {
it("should display deleteriousness help", () => {
cy.get("thead th")
.contains("div","Deleteriousness")
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display conservation help", () => {
cy.get("thead th")
.contains("div","Conservation")
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display population frequencies help", () => {
cy.get("thead th")
.contains("div","Population Frequencies")
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display clinical info help", () => {
cy.get("thead th")
.contains("div","Clinical Info")
.within(() => {
cy.get("a")
.trigger("mouseover");
it("should display content tooltips", () => {
// Select first row, first column: Variant
// variant == id
cy.wrap(tooltips).each(tooltip => {
cy.get("@grid")
.contains("th", tooltip.title)
.invoke("index")
.then(i => {
cy.get("@body")
.find(`tr:first td:nth-child(${i+1}) a`)
.trigger("mouseover");
cy.get(".qtip-content")
.should("be.visible");
});
});
});
cy.get(".qtip-content")
.should("be.visible");
});
});

Expand Down
17 changes: 15 additions & 2 deletions cypress/e2e/iva/variant-interpreter-grid-germline.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,27 @@ context("Variant Interpreter Grid Germiline", () => {

it("should display ACMG Prediction (Classification) tooltip", () => {
cy.get("tbody tr:first > td")
.eq(15)
.eq(16)
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

it("should display OMIM Prediction (Classification) tooltip", () => {
UtilsTest.changePage(browserInterpreterGrid,2);

cy.get("tbody tr:nth-child(6) > td:nth-child(15)")
.within(() => {
cy.get("a")
.trigger("mouseover");
});
cy.get(".qtip-content")
.should("be.visible");
});

});

context("Helpers", () => {
Expand Down Expand Up @@ -236,7 +249,7 @@ context("Variant Interpreter Grid Germiline", () => {
.should("be.visible");
});

it("should display interpretation column hel`", () => {
it("should display interpretation column help", () => {
cy.get("thead th")
.contains("div","Interpretation")
.within(() => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"eonasdan-bootstrap-datetimepicker": "~4.17.43",
"file-saver": "~1.3.2",
"highcharts": "^8.0.4",
"html-to-pdfmake": "^2.4.23",
"jquery": "~2.2.4",
"jquery.json-viewer": "^1.4.0",
"jszip": "^3.10.1",
Expand All @@ -69,7 +70,7 @@
"lodash": "^4.17.19",
"moment": "^2.15.1",
"pako": "~0.2.8",
"pdfmake": "~0.1.20",
"pdfmake": "^0.2.7",
"qtip2": "~3.0.3",
"select2": "^4.1.0-rc.0",
"select2-bootstrap-theme": "0.1.0-beta.10",
Expand Down
5 changes: 5 additions & 0 deletions src/core/bioinfo/bioinfo-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ export default class BioinfoUtils {
return `https://hpo.jax.org/app/browse/term/${hpoTerm}`;
}

static getOmimLink(omimEntry) {
return `https://www.omim.org/entry/${omimEntry}`;
}

static getSequenceOntologyLink(soTerm) {
return `http://www.sequenceontology.org/browser/current_svn/term/${soTerm}`;
}
Expand All @@ -273,4 +277,5 @@ export default class BioinfoUtils {
static getOrphanetLink(orphaId) {
return `https://www.orpha.net/consor/cgi-bin/OC_Exp.php?lng=EN&Expert=${orphaId}`;
}

}
3 changes: 2 additions & 1 deletion src/core/utils-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ export default class UtilsNew {

static dateFormatter(date, format) {
const _format = format ? format : "D MMM YYYY";
return moment(date, "YYYYMMDDHHmmss").format(_format);
const _date = moment(date).isValid() ? moment(date) : moment(date, "YYYYMMDDHHmmss");
return _date.format(_format);
}

static arrayDimension(array) {
Expand Down
Loading

0 comments on commit 4e9dd48

Please sign in to comment.