Skip to content

Commit

Permalink
wc - Individual Annotations minor improvement
Browse files Browse the repository at this point in the history
Signed-off-by: gpveronica <[email protected]>
  • Loading branch information
gpveronica committed Nov 6, 2023
1 parent 838828d commit 86d0992
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
17 changes: 8 additions & 9 deletions cypress/e2e/iva/individual-browser-grid.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ context("Individual Browser Grid", () => {
});
});
// 5.2 Render each varSet column at the position configured in position
it("should have varSet index configured equal to index displayed on Risk Assessment", () => {
it("should have varSet position configured equal to the index of the corresponding column", () => {
cy.wrap(annotations).each(annotation => {
cy.get("@table")
.contains("thead tr th", annotation.title)
Expand All @@ -405,23 +405,22 @@ context("Individual Browser Grid", () => {
});
});
// 5.3 Render variables correctly
it("should have varSet index configured equal to index displayed on Risk Assessment", () => {
it("should render annotations configured", () => {
cy.wrap(annotations).each(annotation => {
cy.get("@table")
.contains("thead tr th", annotation.title)
.invoke("index")
.then(i => {
// 1. Test index column configured equals column index rendered
cy.get("tbody tr").first()
.find(`td:nth-child(${i+1})`).then(cell => {
const text = cell.text();
expect(text).contains(annotation.variables[0]);

cy.get("tbody tr")
.first()
.find("td")
.eq(i)
.should("contain.text", annotation.variables[0]);
});
});
});
});
});
});
});

// DETAIL TABS
Expand Down
18 changes: 4 additions & 14 deletions src/sites/test-app/webcomponents/individual-browser-grid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import {html, LitElement} from "lit";
import UtilsNew from "../../../core/utils-new.js";
import "../../../webcomponents/loading-spinner.js";
import "../../../webcomponents/individual/individual-grid.js";
import "../../../webcomponents/individual/individual-detail.js";
import "../../../webcomponents/individual/individual-view.js";
Expand Down Expand Up @@ -54,17 +53,10 @@ class IndividualBrowserGridTest extends LitElement {
this.FILES = [
"individuals-platinum.json",
];
this._data = [];
this._data = null;
this._selectedInstance = {};

this._config = {};
this.isLoading = false;

}

#setLoading(value) {
this.isLoading = value;
this.requestUpdate();
}

update(changedProperties) {
Expand All @@ -81,7 +73,6 @@ class IndividualBrowserGridTest extends LitElement {
}

propertyObserver() {
this.#setLoading(true);
if (this.opencgaSession && this.testDataVersion) {
const promises = this.FILES.map(file => {
return UtilsNew.importJSONFile(`./test-data/${this.testDataVersion}/${file}`);
Expand All @@ -98,8 +89,6 @@ class IndividualBrowserGridTest extends LitElement {
})
.catch(error => {
NotificationUtils.dispatch(this, NotificationUtils.NOTIFY_RESPONSE, error);
}).finally(() => {
this.#setLoading(false);
});
}
}
Expand Down Expand Up @@ -322,6 +311,7 @@ class IndividualBrowserGridTest extends LitElement {
position: 7,
variableSetId: "risk_assessment",
variables: ["date_risk_assessment"]

}
];

Expand All @@ -333,8 +323,8 @@ class IndividualBrowserGridTest extends LitElement {
}

render() {
if (this.isLoading) {
return html`<loading-spinner></loading-spinner>`;
if (!this._data) {
return html`Processing`;
}

return html`
Expand Down

0 comments on commit 86d0992

Please sign in to comment.