-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: share link and test #6385
fix: share link and test #6385
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,11 @@ | |
|
||
const GENES = ["DPM1", "TNMD", "TSPAN6"]; | ||
|
||
const DATASETS = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we've removed datasets as a filter option in the app |
||
const PUBLICATIONS = [ | ||
// (thuang): This publication has blood and lung tissues | ||
{ | ||
id: "d8da613f-e681-4c69-b463-e94f5e66847f", | ||
text: "A molecular single-cell lung atlas of lethal COVID-19", | ||
}, | ||
{ | ||
id: "de2c780c-1747-40bd-9ccf-9588ec186cee", | ||
text: "Immunophenotyping of COVID-19 and influenza highlights the role of type I interferons in development of severe COVID-19", | ||
id: "Ren et al. Cell 2021", | ||
text: "Ren et al. (2021) Cell", | ||
}, | ||
]; | ||
|
||
|
@@ -53,8 +50,8 @@ | |
const SHARE_LINK_SEARCH_PARAMS = new URLSearchParams(); | ||
SHARE_LINK_SEARCH_PARAMS.set("compare", COMPARE); | ||
SHARE_LINK_SEARCH_PARAMS.set( | ||
"datasets", | ||
DATASETS.map((dataset) => dataset.id).join() | ||
"publications", | ||
PUBLICATIONS.map((publication) => publication.id).join() | ||
); | ||
SHARE_LINK_SEARCH_PARAMS.set( | ||
"diseases", | ||
|
@@ -113,7 +110,7 @@ | |
}); | ||
}); | ||
|
||
test.skip("Should generate share link with correct format for all query param types", async ({ | ||
test("Should generate share link with correct format for all query param types", async ({ | ||
page, | ||
browserName, | ||
}) => { | ||
|
@@ -130,8 +127,7 @@ | |
linkVersion: LATEST_SHARE_LINK_VERSION, | ||
tissueIds, | ||
genes: GENES, | ||
// TODO(seve): #6131 test is currently failing on dataset param, should investigate and reenable | ||
// datasets: DATASETS, | ||
publications: PUBLICATIONS, | ||
sexes: SEXES, | ||
diseases: DISEASES, | ||
ethnicities: ETHNICITIES, | ||
|
@@ -168,7 +164,7 @@ | |
linkVersion, | ||
tissueIds, | ||
genes, | ||
datasets, | ||
publications, | ||
sexes, | ||
diseases, | ||
ethnicities, | ||
|
@@ -179,7 +175,7 @@ | |
linkVersion: string; | ||
tissueIds?: string[]; | ||
genes?: string[]; | ||
datasets?: ExpectedParam[]; | ||
publications?: ExpectedParam[]; | ||
sexes?: ExpectedParam[]; | ||
diseases?: ExpectedParam[]; | ||
ethnicities?: string[]; | ||
|
@@ -195,6 +191,11 @@ | |
"navigator.clipboard.readText()" | ||
); | ||
|
||
/** | ||
* (thuang): The param order below needs to match the order from the ShareButton | ||
* component | ||
*/ | ||
|
||
// split parameters | ||
const urlParams = new URLSearchParams( | ||
// (thuang): We only want the query params part of the URL, so we split by "?" | ||
|
@@ -210,15 +211,6 @@ | |
searchParams.set(param, compare); | ||
} | ||
|
||
// datasets | ||
if (datasets !== undefined) { | ||
const param = "datasets"; | ||
|
||
const data = await verifyParameter(page, urlParams, param, datasets); | ||
|
||
searchParams.set(param, String(data)); | ||
} | ||
|
||
// diseases | ||
if (diseases !== undefined) { | ||
const param = "diseases"; | ||
|
@@ -237,6 +229,15 @@ | |
searchParams.set(param, String(data)); | ||
} | ||
|
||
// publications | ||
if (publications !== undefined) { | ||
const param = "publications"; | ||
|
||
const data = await verifyParameter(page, urlParams, param, publications); | ||
|
||
searchParams.set(param, String(data)); | ||
} | ||
|
||
// sexes | ||
if (sexes !== undefined) { | ||
const param = "sexes"; | ||
|
@@ -299,17 +300,17 @@ | |
const expectedIds = expectedParams.map((expectedParam) => expectedParam.id); | ||
|
||
switch (param) { | ||
case "datasets": { | ||
case "publications": { | ||
const paramValues = getParamValues(param); | ||
|
||
// verify datasets have been selected | ||
// verify publications have been selected | ||
paramValues.forEach(async (_id: string) => { | ||
const item = expectedParams.find( | ||
(expectedParam) => expectedParam.id === _id | ||
); | ||
|
||
if (item) { | ||
await expect(page.getByText(item.text)).toBeVisible(); | ||
Check failure on line 313 in frontend/tests/features/wheresMyGene/shareLink.test.ts GitHub Actions / e2e-tests chromium 9 of 10[chromium] βΊ tests/features/wheresMyGene/shareLink.test.ts:113:7 βΊ Share link tests βΊ Should generate share link with correct format for all query param types
Check failure on line 313 in frontend/tests/features/wheresMyGene/shareLink.test.ts GitHub Actions / e2e-tests chromium 9 of 10[chromium] βΊ tests/features/wheresMyGene/shareLink.test.ts:113:7 βΊ Share link tests βΊ Should generate share link with correct format for all query param types
|
||
} | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allTissueNames = Object.keys(tissueIdsByName);
was returning an empty array, sinceObject.keys()
doesn't work with Map! TIL π‘This fixes the bug where share link tissue with tissue name won't get populated in the app state