Skip to content

Commit

Permalink
Restore test; upstream pathway available again
Browse files Browse the repository at this point in the history
  • Loading branch information
eweitz committed Nov 13, 2024
1 parent 677360d commit 61eb68a
Showing 1 changed file with 53 additions and 55 deletions.
108 changes: 53 additions & 55 deletions test/online/related-genes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,66 +147,64 @@ describe('Ideogram related genes kit', function() {
const ideogram = Ideogram.initRelatedGenes(config);
});

// Uncomment this test after 2024-11-12.
// The needed pathway was unapproved, now it is approved.
// it('handles pathway genes', done => {
it('handles pathway genes', done => {

// async function callback() {
// await ideogram.plotRelatedGenes('RAD51');

// setTimeout(async function() {

// const rad54lLabel = document.querySelector('#ideogramLabel__c0_a0');
// rad54lLabel.dispatchEvent(new Event('mouseover'));
// const pathwayLink = document.querySelector('.ideo-pathway-link');
// const pathwayName = 'Integrated breast cancer pathway';
// assert.equal(pathwayLink.textContent, pathwayName);

// // Test interaction gene summary processing, where one gene
// // is part of a WikiPathways group
// const tooltip = document.querySelector('#_ideogramTooltip');
// assert.include(tooltip.textContent, 'Stimulated by RAD51 in');

// setTimeout(async function() {
// pathwayLink.dispatchEvent(new Event('click'));

// setTimeout(async function() {
// const brca2Annot =
// document.querySelector('#chr13-9606 .annot path');
// const brca2Color = brca2Annot.getAttribute('fill');
// assert.equal(brca2Color, 'green');
// done();
// }, 2000);
// }, 2000);
// }, 5000);
// }
async function callback() {
await ideogram.plotRelatedGenes('RAD51');

// function onClickAnnot(annot) {
// ideogram.plotRelatedGenes(annot.name);
// }
setTimeout(async function() {

// function onWillShowAnnotTooltip(annot) {
// const ideo = this;
// const analytics = ideo.getTooltipAnalytics(annot, ideo);
// assert.equal(analytics.tooltipRelatedType, 'interacting');
// return annot;
// }
const rad54lLabel = document.querySelector('#ideogramLabel__c0_a0');
rad54lLabel.dispatchEvent(new Event('mouseover'));
const pathwayLink = document.querySelector('.ideo-pathway-link');
const pathwayName = 'Integrated breast cancer pathway';
assert.equal(pathwayLink.textContent, pathwayName);

// var config = {
// organism: 'Homo sapiens', // Also tests standard, non-slugged name
// chrWidth: 8,
// chrHeight: 90,
// chrLabelSize: 10,
// annotationHeight: 5,
// onLoad: callback,
// dataDir: '/dist/data/bands/native/',
// cacheDir: '/dist/data/cache/',
// onClickAnnot,
// onWillShowAnnotTooltip
// };
// Test interaction gene summary processing, where one gene
// is part of a WikiPathways group
const tooltip = document.querySelector('#_ideogramTooltip');
assert.include(tooltip.textContent, 'Stimulated by RAD51 in');

// const ideogram = Ideogram.initRelatedGenes(config);
// });
setTimeout(async function() {
pathwayLink.dispatchEvent(new Event('click'));

setTimeout(async function() {
const brca2Annot =
document.querySelector('#chr13-9606 .annot path');
const brca2Color = brca2Annot.getAttribute('fill');
assert.equal(brca2Color, 'green');
done();
}, 2000);
}, 2000);
}, 5000);
}

function onClickAnnot(annot) {
ideogram.plotRelatedGenes(annot.name);
}

function onWillShowAnnotTooltip(annot) {
const ideo = this;
const analytics = ideo.getTooltipAnalytics(annot, ideo);
assert.equal(analytics.tooltipRelatedType, 'interacting');
return annot;
}

var config = {
organism: 'Homo sapiens', // Also tests standard, non-slugged name
chrWidth: 8,
chrHeight: 90,
chrLabelSize: 10,
annotationHeight: 5,
onLoad: callback,
dataDir: '/dist/data/bands/native/',
cacheDir: '/dist/data/cache/',
onClickAnnot,
onWillShowAnnotTooltip
};

const ideogram = Ideogram.initRelatedGenes(config);
});

// // TODO: Restore this
// it('handles gene with paralogs but no interacting genes', done => {
Expand Down

0 comments on commit 61eb68a

Please sign in to comment.