1560 Commits

Author SHA1 Message Date
Bryan Housel
2b46440429 Add Relation#hasFromViaTo method and tests 2019-04-29 21:39:40 -04:00
Bryan Housel
bd2490a965 Reverse internal left/right/forward/backward keyparts
(closes #6235)

Previously only trailing keyparts would reverse:
 `cycleway:left` ⟺  `cycleway:right`
Now it can do internal keyparts too:
 `cycleway:left:surface` ⟺  `cycleway:right:surface`
2019-04-29 21:13:18 -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
fceb1a86f7 Merge pull request #6245 from openstreetmap/d3-v5
d3 v5
2019-04-29 15:46:08 -04:00
Bryan Housel
e981cd5dd5 Switch mapillary and openstreetcam tests to work async
- can't reliably use sinon.spy to tell whether a thing has been called,
  so we listen for events instead and check server.requests()
- make sure to request the next page before dispatching `loadedImages` so
  we can `server.respond()` to the request in the event handler if we want to
- also moves `localeDateString` in the openstreetcam service from parsing
  code to display code, because it's very slow (we can just do this for the
  images we look at, instead of all images we fetch)
2019-04-29 15:31:08 -04:00
Bryan Housel
af31b84b1d Keep track of whether requests have been processed
This lets us call `respond` multiple times, which is useful for the
tests which fetch data in pages.
2019-04-29 13:03:01 -04:00
Bryan Housel
452eb8b43a Bump timeouts on streetlevel loadimage-type tests
This isn't perfect but might avoid spurious test failures.
2019-04-27 17:41:58 -04:00
Bryan Housel
d0452e6be4 Convert fakeServer tests to use fakeFetch
- Many text expects are now wrapped in setTimeout, as the fetch
  promises settle async now.
- This makes the tests somewhat brittle, and we should maybe consider
  reworking some of them. For example it is very hard to perform
  a test like `expect(spy).to.have.not.been.called` in an async way.
  (We could instead inspect the fakeServer requests() to know this.)
- Also includes some trickery for osm.js, which uses d3-xml (fetch)
  now for unauthenticated calls and osmauth (xhr) for authenticated calls
2019-04-26 22:29:48 -04:00
Bryan Housel
552ea46c43 Wrap the fake-fetch methods with sinon.fakeServer-like interface
This mimics `respondWith` and `respond` to keep the tests mostly
similar between `FakeFetch` and `sinon.fakeServer`

Major difference is that all the fakeServer tests which were sync
are now async and this is probably unavoidable.
2019-04-26 22:25:57 -04:00
Bryan Housel
3e363fed8b Make sure to return a new Response each time, not the same one
You can only consume a response once - thereafter the response
body becomes "locked" and will throw an error if you try.
https://stackoverflow.com/questions/53511974/javascript-fetch-failed-to-execute-json-on-response-body-stream-is-locked
2019-04-25 19:22:11 -04:00
Bryan Housel
6f31062d32 Add support for sinon-stubbing fetch API to spec_helpers 2019-04-25 14:13:08 -04:00
Quincy Morgan
7d29a98a14 Add subtype to some validation issues 2019-04-25 10:35:27 -07:00
Quincy Morgan
aa91c2d768 Move old multipolygon warning into Outdated Tags rule (close #6218) 2019-04-24 15:46:50 -07:00
Quincy Morgan
13f7e536dc Move highway=road validation warning to the missing_tag validation rule (re: #6218) 2019-04-24 15:19:57 -07:00
Bryan Housel
05949608aa Support straightening of points
(closes #6217)

- Split `actionStraighten` into `actionStraightenWay` and `actionStraightenNodes`
- Now `operationStraighten` chooses the correct action depending on selected entities
- Also move `getSmallestSurroundingRectangle` from `actionReflect` to `geo.js`
2019-04-24 01:55:43 -04:00
Bryan Housel
bd2a33d845 Merge branch 'validation_and_change_perf' 2019-04-23 01:30:26 -04:00
Quincy Morgan
e04d860f62 Convert "Detach" operation into "Extract" operation that also works on areas (close #6203) 2019-04-22 14:46:01 -07:00
Bryan Housel
51c1088c1b Merge branch 'master' into validation_and_change_perf 2019-04-19 15:18:23 -04:00
Quincy Morgan
e3e3fd1ad3 Fix Wikipedia field test 2019-04-15 15:32:57 -07:00
Bryan Housel
294ce00211 substitute 'info' for 'data' (so I can use 'info' for an info drawer) 2019-04-15 16:56:21 -04:00
Bryan Housel
f6708fd84c Hide feature if _all_ rules hidden (was: if _any_ rule hidden)
This matters as we start to match more rules for hybrid features like rail
platforms, which now match both path and rail.  We want to show them unless the
user has hidden all the rules that they match.

Also this changes the test code slightly to actually test rule matching.
Before it was really just testing hiding.
2019-04-15 10:20:58 -04:00
Bryan Housel
36d1f3701f Allow osm service tests to work with deferred parsing 2019-04-12 12:11:35 -04: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
0a77a494aa Merge branch 'master' into validation_and_change_perf 2019-04-10 14:22:20 -04:00
Bryan Housel
e30090996b Add loadTileAtLoc to fetch data tile for a specific location
(closes #4890)

This lets iD request needed tiles outside of the viewport, for example to
properly straighten lines or validate features that may have unloaded
connections.
2019-04-09 23:49:31 -04:00
Bryan Housel
95a1bbaf97 Add downloaded debug flag and visualization for tiles downloaded 2019-04-08 22:06:47 -04:00
Bryan Housel
df1a2ea361 Prevent some actions on features that extend beyond the loaded map
(closes #2248)
2019-04-08 21:26:58 -04:00
Bryan Housel
2660a8554b Add isDataLoaded and tilecache rtree for testing
(re: #2248, #5938, maybe others)
2019-04-08 15:59:42 -04:00
Quincy Morgan
50a0982d79 Merge pull request #6161 from jguthrie100/fix_closed_way_disconnect
Leave way as closed when disconnecting
2019-04-08 11:08:33 -07:00
J Guthrie
bd44cec2e8 Fix broken testcase! 2019-04-08 16:48:27 +01:00
J Guthrie
57a0358061 Add test cases 2019-04-08 15:19:21 +01:00
Bryan Housel
1bcc0f613c WIP: fix caches, replace id() function with plain id property 2019-04-05 17:41:04 -04:00
Quincy Morgan
6dd9e9ce48 Add code tests for incompatible_source validation 2019-04-05 13:53:57 -07:00
Bryan Housel
82a9375e0f Move coreValidator test to test/spec/core/validator.js 2019-04-05 09:34:53 -04:00
Bryan Housel
8b1c0551cc WIP: understand state held by the validator, avoid translations
- Make sure all state variables prefixed with `_`
- Add explicit `init`/`reset` methods
  (graph/entity refs should never persist through a save to OSM)
- Thinking of how best cache validation results
2019-04-05 09:28:36 -04:00
Bryan Housel
167824a530 Make sure all nodes have an actual loc property
- This is to make difference comparisons easier
- The only nodes that didn't have a `loc` were fake nodes we made for testing
- So this commit also fixes the `osmIntersection` code and tests.
2019-04-03 16:20:45 -04:00
Bryan Housel
d18b951c67 Remove lodash flatten and flattenDeep
(re: #6087)
2019-03-28 10:04:46 -04:00
Bryan Housel
3896b2282f Remove lodash isNaN, isNumber, isString, bind, uniqBy
(re: 6087)
2019-03-27 23:11:45 -04:00
Bryan Housel
3d80e6505f Remove lodash chunk, groupBy
(re: #6087)
2019-03-27 16:18:41 -04:00
Bryan Housel
c5c0d27c85 Add util functions for set operations 2019-03-26 17:50:00 -04:00
Bryan Housel
4821bf0a68 Remove lodash omit
(re: #6087)
2019-03-26 14:12:45 -04:00
Bryan Housel
9e4cf126c3 Remove unneeded utilGetPrototypeOf and just use Object.getPrototypeOf 2019-03-25 22:16:58 -04:00
Bryan Housel
daaab30d13 Add workaround for Array.from when running in PhantomJS
https://github.com/openstreetmap/iD/issues/6087#issuecomment-476219308

Also added `npm run phantom` to test workarounds like this quickly
2019-03-25 12:47:55 -04:00
Bryan Housel
0c7d98673a Fix form of chai not called assertion 2019-03-25 10:03:27 -04:00
Bryan Housel
26113d0e25 Remove unneeded getOwnPropertySymbols polyfill 2019-03-24 01:48:36 -04:00
Bryan Housel
11bfeaabfc Add browser-polyfills, remove lodash assign, compact, values
(re: #6087)
2019-03-22 17:14:41 -04:00
J Guthrie
470d6c257d Update to work on ways going in opposite directions 2019-03-22 15:29:48 -04:00
J Guthrie
d07418c654 Enforce either 0 or 2 selected vertices 2019-03-22 15:29:47 -04:00
J Guthrie
16513b1194 Update operationStraighten.available() function
- operationStraighten now allows for two vertices to be selected and straightened between
 - Added test cases
2019-03-22 15:29:47 -04:00
J Guthrie
f2722fe95f Add operationStraighten tests for 2 selected vertices 2019-03-22 15:29:47 -04:00