Skip to content

[2.11] Fix double click zoom counting on maps layers tests - #2088

Merged
Hailong-am merged 1 commit into
opensearch-project:2.11from
q-andy:fix/opensearchMapLayer-cypress9-dblclick-2.11
Jul 20, 2026
Merged

[2.11] Fix double click zoom counting on maps layers tests#2088
Hailong-am merged 1 commit into
opensearch-project:2.11from
q-andy:fix/opensearchMapLayer-cypress9-dblclick-2.11

Conversation

@q-andy

@q-andy q-andy commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes miscounted double click zooms on maps layer tests.

Tested locally with headless cypress

yarn cypress:run-without-security \
    --spec 'cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js'

yarn cypress:run-without-security \
    --spec 'cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js'
yarn run v1.22.22
$ env TZ=America/Los_Angeles NO_COLOR=1 cypress run --headless --env SECURITY_ENABLED=false --spec cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js
Couldn't determine Mocha version

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v20.20.2 (/Users/qinandy/.nvm/versions/node/v20.20.2/bin/node)                 │
  │ Specs:          1 found (plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js)      │
  │ Searched:       cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.sp │
  │                 ec.js                                                                          │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js                 (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Couldn't determine Mocha version


  Default OpenSearch base map layer
[74432:0715/135452.708065:ERROR:shared_image_manager.cc(214)] SharedImageManager::ProduceSkia: Trying to Produce a Skia representation from a non-existent mailbox.
    ✓ check if default OpenSearch map layer can be open (18380ms)


  1 passing (21s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     20 seconds                                                                       │
  │ Spec Ran:     plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /Users/qinandy/opensearch/opensearch-dashboards-functional-     (1 second)
                          test/cypress/videos/plugins/custom-import-map-dashboards/op               
                          ensearchMapLayer.spec.js.mp4                                              


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/custom-import-map-dashboard      00:20        1        1        -        -        - │
  │    s/opensearchMapLayer.spec.js                                                                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:20        1        1        -        -        -  

Issues Resolved

n/a

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix mismatch between zoom clicks and assertion

The loop clicks the zoom-in button 5 times, but the assertion expects zoom: 4.
Assuming the map starts at zoom level 0, 5 clicks should result in zoom: 5. Either
adjust the loop count to 4 or update the expected zoom value to 5 to match the
actual behavior.

cypress/integration/plugins/custom-import-map-dashboards/opensearchMapLayer.spec.js [34-37]

-for (let i = 0; i < 5; i++) {
+for (let i = 0; i < 4; i++) {
   cy.get('.maplibregl-ctrl-zoom-in').click();
 }
 cy.get('[data-test-subj="mapStatusBar"]').should('contain', 'zoom: 4');
Suggestion importance[1-10]: 4

__

Why: The suggestion identifies a potential mismatch between the number of zoom clicks (5) and the expected zoom level (4). However, the initial zoom level of the map is not known from the diff, so the assumption that the map starts at zoom 0 may be incorrect. The actual test author likely verified the expected zoom value empirically.

Low

@q-andy q-andy changed the title Fix double click zoom counting on maps layers tests [2.11] Fix double click zoom counting on maps layers tests Jul 16, 2026
Signed-off-by: Andy Qin <qinandy@amazon.com>
@q-andy
q-andy force-pushed the fix/opensearchMapLayer-cypress9-dblclick-2.11 branch from 41d7dec to dc2653d Compare July 16, 2026 22:37
@q-andy
q-andy marked this pull request as ready for review July 17, 2026 00:03
@Hailong-am
Hailong-am merged commit 4b56ceb into opensearch-project:2.11 Jul 20, 2026
18 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants