189 Commits

Author SHA1 Message Date
Martin Raifer
1705bb97e5 clean up preferred locale codes after tests 2025-03-24 15:31:41 +01:00
Kyℓe Hensel
fd49a10f1c consider language scripts when determining the locale to use (#10910) 2025-03-24 14:27:18 +01:00
Martin Raifer
918126e5f8 revalidate entities with changed relation memberships 2025-02-18 13:19:32 +01:00
Kyℓe Hensel
6f16060a78 mass-replace done() function with async/await (#10781) 2025-02-17 13:10:04 +01:00
andrewpmk
a7038955ca Revalidate disconnected_way and impossible_oneway errors on change (#8911) 2025-02-15 18:45:32 +01:00
Kyle Hensel
7afecd39ec minor tweaks to make some tests pass 2024-09-03 19:23:21 +10:00
Martin Raifer
fafb9f3d41 add test case for #10342 2024-07-26 11:59:06 +02:00
Minh Nguyễn
653582f268 Added tests of padding zero 2023-03-04 18:52:50 -08:00
Minh Nguyễn
023907f9e2 Fixed incrementing/decrementing formatted numbers
The float formatter function now takes a number of fraction digits to return.
2023-03-04 18:36:06 -08:00
Minh Nguyễn
5d224a41cd Strip literal (bidi) characters when parsing numbers 2023-03-03 22:42:15 -08:00
Minh Nguyễn
ecb7c20bbf Avoid truncation when formatting numbers 2023-03-03 22:42:14 -08:00
Minh Nguyễn
2ba7177080 Polyfill inadequate Intl support
Ensure that formatting is balanced with parsing to avoid truncating numbers.
2023-03-03 22:42:14 -08:00
Minh Nguyễn
252828bb4b Localize numbers in numeric fields 2023-03-03 22:42:14 -08:00
Bryan Housel
2b2a71f597 Don't pre-resolve and index complex locationSets into GeoJSON.
This was taking a lot of time at app startup.

Instad now we resolve and index only the include and exclude parts.
We can still determine the valid locationSets at runtime in `locationSetsAt()`
by checking the `_locationIncludedIn` and `_locationExcludedIn` caches.

This also upgrades the locationManger to an ES6 class.

This also includes some hacky code in nsi.js so that the NSI will continue to work.
The NSI matcher can build its own location index, but it doesn't need to do this.
We monkeypatch a few of the matcher collections to work with the new LocationManager.
2022-10-28 10:49:01 -04:00
Martin Raifer
f6e4596b59 remove now unneeded refrences to and workarounds for phantomJS 2022-02-03 13:12:00 +01:00
Martin Raifer
e5aedb249f add basic test case for t.append method 2021-11-30 11:31:58 +01:00
Bryan Housel
33fab5580b Before calling init() make sure the assetPath is set
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
2021-08-16 22:06:42 -04:00
Bryan Housel
4f1d5f0851 Similar to e7ad3845f, avoid using finally(done) as it swallows errors 2021-08-16 15:34:26 -04:00
Bryan Housel
e7ad3845f9 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
2021-08-16 15:23:31 -04:00
Bryan Housel
746417e1f4 Fix coreLocations tests access of locationSetID property 2021-08-16 14:11:36 -04:00
Bryan Housel
11201eb822 Rewrite the validator in ES6/Promises, several improvements here:
- implements a validation work queue, jobs are run during browser idle callbacks
- when merging base entities, don't run validations 2x on both base and head graphs (this was wasteful)
- keep track of resolved issues in a separate set (it's not a simple compare of base/head anymore)
  this happens after validation queue is empty and avoids race conditions and inaccurate resolved counts
2021-01-25 12:50:11 -05:00
Bryan Housel
74d28257c4 Fix teh misspellings 2021-01-18 19:48:35 -05:00
Bryan Housel
d3fb8c60f9 Upgrade validations outdated_tags, suspicious_names to NSI v5 2021-01-13 13:46:00 -05:00
Bryan Housel
2d8c90786f coreLocation tests, documentation 2021-01-11 13:01:30 -05:00
Quincy Morgan
a58abe3c6f Move localStorage interface from a property of coreContext to a corePreferences function 2020-04-01 11:00:48 -07:00
Quincy Morgan
a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00
Bryan Housel
919687d2cf Replace legacy names still used in tests, remove the legacy exports 2020-02-21 23:12:25 -05:00
Bryan Housel
e19bcb77d5 Require init() call before coreContext starts doing things
(closes #7304)
2020-01-29 19:27:12 -05:00
Bryan Housel
9154a6a554 context.asset should pass-through absolute URLs 2020-01-29 15:22:06 -05:00
Bryan Housel
89724cfb1b Remove support for debug rendering of the community index
We have http://openstreetmap.community now for this, and it eliminates
another place in the code where that data would have been needed.
This commit also ES6ifies svgDebug.
2020-01-29 13:35:25 -05:00
Bryan Housel
c481f90e7d Stop bundling wmf-sitematrix, move it extern
This also includes a bunch of tweaks to make the tests work
in both PhantomJS and modern browsers like Chrome.

Basically - introduce some more async into the test code so that
the coreData.get promise is guaranteed to settle.  Because in
PhantomJS the promise is polyfilled, and Chrome it's native, they
work slightly differently.
2020-01-29 12:30:11 -05:00
Bryan Housel
567eeac587 Make several data external instead of bundled:
Also dist/data/* contains minified files now

These are now external and will fetch as needed:
-export { dataAddressFormats } from './address-formats.json';
-export { dataDeprecated } from './deprecated.json';
-export { dataDiscarded } from './discarded.json';
-export { dataLanguages } from './languages.json';
-export { dataPhoneFormats } from './phone-formats.json';
-export { dataShortcuts } from './shortcuts.json';
-export { dataTerritoryLanguages } from './territory-languages.json';
2020-01-28 22:21:31 -05:00
Bryan Housel
ce7cac6738 Move all the build scripts into scripts/ folder, ES6ify more stuff 2020-01-28 15:00:23 -05:00
Bryan Housel
6d81a00daf Let caller modify the coreData fileMap, and add tests 2020-01-28 10:27:45 -05:00
Bryan Housel
511f8ecc82 Allow user to adjust the threshold for the unsquare building warning 2019-05-18 15:44:29 -04:00
Bryan Housel
86c6805cf7 Optionally include ids members of modified relations in extantIDs
(closes #6273)
2019-05-08 13:53:48 -04:00
Bryan Housel
b0d5f0dd48 Include multipolygon members in complete()
(closes #3613)
2019-05-08 00:49:33 -04:00
Quincy Morgan
375779882d Add ability to ignore warnings
Replace issue's array of entities with array of entity IDs
Improve issue ID hashing
2019-04-29 17:52:32 -07:00
Bryan Housel
0dd262d1dd Don't dispatch 'change' on history.merged, dispatch 'merge' only
Change performs an expensive immediate redraw, and merge can schedule
a redraw for later.
2019-04-12 09:56:18 -04:00
Bryan Housel
95a1bbaf97 Add downloaded debug flag and visualization for tiles downloaded 2019-04-08 22:06:47 -04:00
Bryan Housel
82a9375e0f Move coreValidator test to test/spec/core/validator.js 2019-04-05 09:34:53 -04:00
Bryan Housel
0c7d98673a Fix form of chai not called assertion 2019-03-25 10:03:27 -04:00
Bryan Housel
6da2ba7b9d Make sure pause/resumeChangeDispatch can be called multiple times 2019-03-06 15:41:12 -05:00
Bryan Housel
0ea69548ea Add history.pauseChangeDispatch / history.resumeChangeDispatch
To avoid dispatching change events at improper times
2019-03-06 15:41:12 -05:00
Bryan Housel
e64693eea5 Upgrade tests from legacy iD.Difference to iD.coreDifference 2019-03-01 16:03:21 -05:00
Bryan Housel
71b2d2c6b7 Upgrade legacy symbols in tests
- iD.Context -> iD.coreContext
- iD.Graph -> iD.coreGraph
- iD.Node -> iD.osmNode
- iD.Way -> iD.osmWay
- iD.Relation -> iD.osmRelation
2019-01-30 15:43:02 -05:00
Bryan Housel
1ffca3ce85 Switch crossing presets to "marked"/"unmarked", retain "zebra" as unsearchable 2018-10-02 17:01:04 -04:00
Bryan Housel
12f7f68dda Fix debug flag test 2018-04-07 22:23:37 -04:00
Bryan Housel
6644c9db6b Fix context.js and vertices.js tests 2017-12-15 18:17:12 -05:00
Bryan Housel
b3842d97f4 Remove lodash from the test suite
(closes #4378)
2017-10-18 14:37:39 -04:00