Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test improvements #8642

Merged
merged 10 commits into from
Sep 28, 2021
Merged

Test improvements #8642

merged 10 commits into from
Sep 28, 2021

Conversation

bhousel
Copy link
Member

@bhousel bhousel commented Aug 16, 2021

A bunch of fixes for the tests.

  • 4f1d5f0 Similar to e7ad384, avoid using finally(done) as it swallows errors

  • e7ad384 Fix file fetcher tests that touch the intro_graph

    • Before it wasn't actually loading the intro graph because assetPath not set
    • The test for Three Rivers City Hall was using the wrong nodeid
    • All these test errors were being ignored because of the use of .finally(done)
    • To actually make an error happen, we can call done(err) with the Error
  • 1282d3b Don't use a util function for a thing that exists 1x in the code

  • 746417e Fix coreLocations tests access of locationSetID property

  • 5aee120 Prefill the locale_tagging_en with fake string data
    This avoids the numerous "missing translation" errors filling up the console

  • bb84962 Only insert sources into the fileMap if not already there
    This allows us to setup the fileMap correctly for testing so that it never tries to fetch assets from the CDN.

This allows us to setup the fileMap correctly for testing so
that it never tries to fetch assets from the CDN.
This avoids the numerous "missing translation" errors filling up the console
- Before it wasn't actually loading the intro graph because assetPath not set
- The test for Three Rivers City Hall was using the wrong nodeid
- All these test errors were being ignored because of the use of .finally(done)
- To actually make an error happen, we can call `done(err)` with the Error
init kicks off building the ui, which can fetch spritesheets for the <defs>
The assetPath needs to be set otherwise these files will not be found
By default, the `rendererBackground` code will choose an initial imagery based on what
sources are available at the given map location. It looks like this code will fallback
to "custom" _before_ "none", and I noticed that in some cases it was trying to fetch
whatever source happened to be stored in the "custom" template in localStorage.

This commit adds an explicit window.location.hash in a few places to encourage the
background layer to be "none". Some tests do change the hash, so this isn't perfect.
The pointer events use a different mechanism for counting clicks that doesn't
work when the tests are run in a real browser like Chrome. This change forces
iD to always use mouse events during testing, even in a real browser.
@mbrzakovic mbrzakovic added this to the 2.20.2 milestone Sep 27, 2021
@mbrzakovic mbrzakovic self-requested a review September 28, 2021 09:06
Copy link
Collaborator

@mbrzakovic mbrzakovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good.

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.

2 participants