Closed ArtPoon closed 1 year ago
I have a question about the tooltips. According to one of the tests (from an older version), the nodes of the tree used to maintain a relationship between their #id and the number of variants.
it('Cluster tooltips contain relevant and correct information', () => {
cy.get('rect:visible').first().trigger('mouseover').invoke('attr','id').as('id')
cy.get('@id').then(id => {
var id_number = id.substring(3)
cy.window().then((win) => {
// Number of variants
cy.get('.tooltip').contains(`Number of variants: ${win.tips[id_number]['varcount']}`)
// Mutations list
cy.wrap(win.tips[id_number]['mutations']).each(($el) => {
cy.get('.tooltip').contains($el)
})
// Regions: Num of Cases
cy.wrap(Object.keys(win.tips[id_number]['allregions'])).each(($el, index) => {
cy.get('.tooltip').contains(`${$el}: ${Object.values(win.tips[id_number]['allregions'])[index]}`)
})
// Mean diffs from root
cy.get('.tooltip').contains(`Mean diffs from root: ${win.tips[id_number]['mean_ndiffs'].toFixed(2)}`)
// Deviation from clock
cy.get('.tooltip').contains(`Deviation from clock: ${win.tips[id_number]['residual'].toFixed(2)}`)
// Collection dates (UTC)
cy.get('.tooltip').contains(`${win.tips[id_number]['first_date'].toISOString().slice(0, 10)} / ${win.tips[id_number]['last_date'].toISOString().slice(0, 10)}`)
})
})
})
From looking at the UI and the code, I couldn't figure out how to modify this test-code to reflect the newer UI.
I'm particularly confused about terms such as win.tips[id_number]['varcount']
For reference, there are a couple of more test files in the iss259
branch.
Let's keep this to a separate branch for now (test-suite
?) and merge iss259
- keep tests off dev
branch for now
@bonnielu added some unit tests for utils.js
@nav-mohan reported a discrepancy between headless and Electron browser unit test results. This is apparently a known issue with Cypress. Open in a new issue.
One of my tests seems to be running into this issue. The test fails in the headless browser. But it passes in the Electron browser. Opening a new issue.
@bonnielu - adding unit tests for beadplot.js
.
There were concerns over the number of times the page refreshes when running the tests. @nav-mohan mentioned that this could be addressed by adding switch
statements:
https://github.com/PoonLab/covizu/blob/0ec4a711e591ae7f6005be550f85994e4726e531/cypress/e2e/covizu.spec.cy.js#L47-L61
@bonnielu continuing to work on this with new test files from @GopiGugan
@bonnielu to continue populating this test suite
@bonnielu to push recent changes into dev
branch
cypress
folder, see examples389