Skip to content

Commit

Permalink
Update localdb test
Browse files Browse the repository at this point in the history
  • Loading branch information
haynescd committed Jun 2, 2023
1 parent bce1af5 commit 137c954
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 12 additions & 5 deletions end-to-end-test/local/specs/core/postedquery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,26 @@ describe('posting query parameters (instead of GET) to query page', function() {
});
});

describe('Post Data for StudyView Filtering with filterJson via HTTP Post', () => {
describe.only('Post Data for StudyView Filtering with filterJson via HTTP Post', () => {
it('Send PatientIdentifier Filter via postData', () => {
const filterJsonQuery = {
patientIdentifiers: [
{ study_id: 'msk_impact_2017', patientId: 'P-0000004' },
],
filterJson:
'{"patientIdentifiers":[{"study_id":"study_es_0","patientId":"TCGA-A1-A0SB" }]}',
};

goToUrlAndSetLocalStorage(`${CBIOPORTAL_URL}`, true);

postDataToUrl(
`${CBIOPORTAL_URL}/study/summary?id=msk_impact_2017`,
`${CBIOPORTAL_URL}/study/summary?id=study_es_0&localdev=true`,
filterJsonQuery
);

const postData = browser.execute(() => {
return window.postData;
});

console.log(postData);
//browser.debug();
getElementByTestHandle('selected-samples').waitForExist({
timeout: 20000,
});
Expand Down
4 changes: 3 additions & 1 deletion src/pages/studyView/StudyViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ export default class StudyViewPage extends React.Component<

private getPostDataFilterJson(): string | undefined {
let rawFilterJsonStr: string | undefined;
const postData = getBrowserWindow()?.postData?.filterJson;
let postData: string = getBrowserWindow()?.postData?.filterJson;
const regx = /&quot;/;
postData = postData.replace(regx, '"');
if (postData) {
try {
JSON.parse(postData);
Expand Down

0 comments on commit 137c954

Please sign in to comment.