Skip to content

Commit

Permalink
Merge pull request #4396 from alisman/pvTest
Browse files Browse the repository at this point in the history
Add e2e test for patient view cohort navigation and annotation results
  • Loading branch information
alisman authored Oct 19, 2022
2 parents 85aa46f + 3adc10c commit 9e01043
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions end-to-end-test/remote/specs/core/patient.screenshot.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var assert = require('assert');

const {
goToUrlAndSetLocalStorage,
checkOncoprintElement,
waitForNetworkQuiet,
} = require('../../../shared/specUtils');
const { assertScreenShotMatch } = require('../../../shared/lib/testUtils');

describe('Patient Cohort View Custom Tab Tests', () => {
const patientUrl = `https://www.cbioportal.org/patient?studyId=coadread_tcga_pub&caseId=TCGA-A6-2670#navCaseIds=coadread_tcga_pub:TCGA-A6-2670,coadread_tcga_pub:TCGA-A6-2672`;

it('Patient page valid after cohort navigation', function() {
goToUrlAndSetLocalStorage(patientUrl);

waitForNetworkQuiet();

$('.nextPageBtn').click();

waitForNetworkQuiet();

var res = browser.checkDocument();
assertScreenShotMatch(res);

// now reload so that we get to the patient via direct initial load (not cohort navigation)
browser.url(browser.getUrl());

waitForNetworkQuiet();

// check that it matches again
var res2 = browser.checkDocument();
assertScreenShotMatch(res2);
});
});
1 change: 0 additions & 1 deletion src/config/IAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export interface IServerConfig {
oncokb_merge_icons_by_default: boolean;
generic_assay_display_text: string; // this has a default
saml_logout_local: boolean;
patient_view_use_legacy_timeline: boolean;
installation_map_url: string;
enable_request_body_gzip_compression: boolean;
enable_treatment_groups: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/config/serverConfigDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const ServerConfigDefaults: Partial<IServerConfig> = {
'TREATMENT_RESPONSE:Treatment Response,MUTATIONAL_SIGNATURE:Mutational Signature,ARMLEVEL_CNA:Arm-level CNA',

saml_logout_local: false,
patient_view_use_legacy_timeline: false,

enable_request_body_gzip_compression: false,
enable_treatment_groups: false,

Expand Down
27 changes: 1 addition & 26 deletions src/pages/patientView/PatientViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,23 @@ import * as React from 'react';
import _ from 'lodash';
import {
CancerStudy,
ClinicalData,
DiscreteCopyNumberData,
ResourceData,
} from 'cbioportal-ts-api-client';
import {
ClinicalDataBySampleId,
RequestStatus,
} from 'cbioportal-ts-api-client';
import { Else, If, Then } from 'react-if';
import SampleManager from './SampleManager';
import PatientHeader from './patientHeader/PatientHeader';
import { PaginationControls } from '../../shared/components/paginationControls/PaginationControls';
import { IColumnVisibilityDef } from 'shared/components/columnVisibilityControls/ColumnVisibilityControls';
import { toggleColumnVisibility } from 'cbioportal-frontend-commons';
import {
parseCohortIds,
PatientViewPageStore,
buildCohortIdsFromNavCaseIds,
} from './clinicalInformation/PatientViewPageStore';
import { inject, observer } from 'mobx-react';
import {
action,
computed,
observable,
reaction,
makeObservable,
Reaction,
IReactionDisposer,
} from 'mobx';
import { action, computed, observable, makeObservable } from 'mobx';
import { default as PatientViewMutationTable } from './mutation/PatientViewMutationTable';
import { MSKTab } from '../../shared/components/MSKTabs/MSKTabs';
import { validateParametersPatientView } from '../../shared/lib/validateParameters';
import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator';
import ValidationAlert from 'shared/components/ValidationAlert';
import PatientViewMutationsDataStore from './mutation/PatientViewMutationsDataStore';
Expand All @@ -56,9 +41,7 @@ import { remoteData, getBrowserWindow } from 'cbioportal-frontend-commons';
import 'cbioportal-frontend-commons/dist/styles.css';
import 'react-mutation-mapper/dist/styles.css';
import 'react-table/react-table.css';
import { trackPatient } from 'shared/lib/tracking';
import PatientViewUrlWrapper from './PatientViewUrlWrapper';
import { PagePath } from 'shared/enums/PagePaths';
import { GeneFilterOption } from './mutation/GeneFilterMenu';
import { checkNonProfiledGenesExist } from './PatientViewPageUtils';
import PatientViewGenePanelModal from './PatientViewGenePanelModal/PatientViewGenePanelModal';
Expand Down Expand Up @@ -158,14 +141,6 @@ export class PatientViewPageInner extends React.Component<

public patientViewPageStore: PatientViewPageStore;

private disposers: IReactionDisposer[] = [];

componentWillUnmount() {
// this will destroy the reaction
// which will free parties for gc
this.disposers.forEach(d => d());
}

constructor(props: IPatientViewPageProps) {
super(props);
makeObservable(this);
Expand Down

0 comments on commit 9e01043

Please sign in to comment.