Skip to content

Commit

Permalink
Merge pull request #983 from opencb/TASK-6700
Browse files Browse the repository at this point in the history
TASK-6700 - Update the Steiner tool to include COSMIC count
  • Loading branch information
jmjuanes authored Sep 24, 2024
2 parents a0346ae + 55da40a commit 0d42375
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
32 changes: 32 additions & 0 deletions cypress/e2e/iva/variant-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,38 @@ context("Variant Browser Grid", () => {
});
});

context("clinical info", () => {
context("cosmic column", () => {
const columnIndex = 18;
it("should display an 'x' icon if no cosmic information is available", () => {
cy.get("@variantBrowser")
.find(`tbody > tr[data-uniqueid="14:91649938:A:G"] > td`)
.eq(columnIndex)
.find("i")
.should("have.class", "fa-times");
});

it("should display the number of entries and total trait associations", () => {
cy.get("@variantBrowser")
.find("tbody tr:first > td")
.eq(columnIndex)
.should("contain.text", "1 entry (1)");
});

it("should display a tooltip with a link to cosmic", () => {
cy.get("@variantBrowser")
.find("tbody tr:first > td")
.eq(columnIndex)
.find("a")
.trigger("mouseover");

cy.get(`div[class="qtip-content"]`)
.find(`a[href^="https://cancer.sanger.ac.uk/cosmic/search?q="]`)
.should("exist");
});
});
});

context("actions", () => {
const variant = "14:91649858:C:T";
beforeEach(() => {
Expand Down
5 changes: 3 additions & 2 deletions src/webcomponents/variant/variant-grid-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,8 +1192,9 @@ export default class VariantGridFormatter {

return `
<a class="cosmic-tooltip" tooltip-title='Links' tooltip-text='${tooltipText}' tooltip-position-at="left bottom" tooltip-position-my="right top">
<span style="color: green">${cosmicMap.size} ${cosmicMap.size > 1 ? "studies" : "study" }</span>
</a>`;
<span style="color: green">${cosmicMap.size} ${cosmicMap.size > 1 ? "entries" : "entry"} (${traits.length})</span>
</a>
`;
case "HGMD":
// Prepare the tooltip links
const hgmdMap = new Map();
Expand Down

0 comments on commit 0d42375

Please sign in to comment.