Skip to content

Commit

Permalink
Merge pull request #840 from geoadmin/bug_PB-368_fix_coordinate_rando…
Browse files Browse the repository at this point in the history
…mizer

PB-368 : fix e2e test feature coordinate randomizer
  • Loading branch information
pakb authored May 14, 2024
2 parents ae8996e + f922385 commit a676c58
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,19 @@ const addFeatureIdentificationIntercepts = () => {
upperY: LV95.bounds.upperY,
}
// if a selection box is sent, we use it as bounds to generate our random coordinates
if (identifyGeometry && identifyGeometry.split(',').length === 4) {
const split = identifyGeometry.split(',').map(parseFloat).map(Math.floor)
identifyBounds.lowerX = split[0]
identifyBounds.upperX = split[2]
identifyBounds.lowerY = split[1]
identifyBounds.upperY = split[3]
if (identifyGeometry) {
const coordinateSplit = identifyGeometry.split(',').map(parseFloat).map(Math.floor)
if (coordinateSplit.length === 4) {
identifyBounds.lowerX = coordinateSplit[0]
identifyBounds.upperX = coordinateSplit[2]
identifyBounds.lowerY = coordinateSplit[1]
identifyBounds.upperY = coordinateSplit[3]
} else if (coordinateSplit.length === 2) {
identifyBounds.lowerX = coordinateSplit[0] - 1000
identifyBounds.upperX = coordinateSplit[0] + 1000
identifyBounds.lowerY = coordinateSplit[1] - 1000
identifyBounds.upperY = coordinateSplit[1] + 1000
}
}

for (let i = 0; i < limit; i++) {
Expand Down

0 comments on commit a676c58

Please sign in to comment.