Skip to content

Commit

Permalink
test(#8): 🧪 Made tests for elevation control and accepted filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
mariewah committed Oct 14, 2025
1 parent 3b79c44 commit 76a18d8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
22 changes: 22 additions & 0 deletions cypress/e2e/filtering.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('Accepted filtering', () => {
it('test accepted filter button', function () {
cy.visit('http://localhost:5173/#')
cy.get('#doAcceptedFilter').click()
})
})

describe('Elevation Control', () => {
it('test elevation control', function () {
cy.visit('http://localhost:5173/#')
cy.get('#btnDoElevationControl').click()

cy.get(
'#elevation_gradient_scheme_selection span:nth-child(8) rect'
).click()
cy.get(
'#elevation_gradient_scheme_selection span:nth-child(3) rect'
).click()

cy.get('#sldHeightRange').click()
})
})
21 changes: 0 additions & 21 deletions src/ElevationControl/elevationControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,6 @@ function ensureActivationButton(hooks) {
list.insertBefore(btn, list.firstChild)
}

// /**
// * Disable any further clicks of the pointcloud icon in the sidebar
// */
// function disableFirstPointCloudNode() {
// // find the <li> that holds the first cloud icon
// const icon = document.querySelector(
// '#scene_objects i.jstree-themeicon-custom'
// )
// const li = icon ? icon.closest('li') : null
// if (!li) return
// //visually/DOM disable anchor clicks
// const a = li.querySelector('a')
// if (a) {
// a.style.pointerEvents = 'none'
// a.style.opacity = 0.5
// a.classList.remove('jstree-clicked')
// }
// }

// (re)connect the elevation labels to the slider after the container is moved
function rebindElevationLabel() {
const slider = window.jQuery ? window.jQuery('#sldHeightRange') : null
Expand Down Expand Up @@ -135,6 +116,4 @@ export function initElevationControls(viewer, hooks = {}) {
}
})
observer.observe(menu, { childList: true, subtree: true })

//disableFirstPointCloudNode()
}
3 changes: 0 additions & 3 deletions src/potreeViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ function suppressSidebarAutoScroll(action, holdMs = 350) {
// full restore
Element.prototype.scrollIntoView = origScrollIntoView
HTMLElement.prototype.focus = origFocus
window.removeEventListener('wheel', preventWindowScroll)
window.removeEventListener('touchmove', preventWindowScroll)
window.removeEventListener('keydown', preventWindowScroll)
states.forEach(({ el, overflow }) => {
const h = handlers.get(el)
if (h) el.removeEventListener('scroll', h)
Expand Down

0 comments on commit 76a18d8

Please sign in to comment.