Commit Graph

58 Commits

Author SHA1 Message Date
Bryan Housel
08c765236f Force tests to use mouse events instead of pointer events
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.
2021-08-18 18:58:30 -04:00
Bryan Housel
b2d18d1ebe Fix hash tests in Chrome, avoid loading imagery tiles 2021-08-18 12:51:13 -04: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
Quincy Morgan
e134cd7ffd Fix and simplify hover test 2020-10-08 14:58:33 -04:00
Quincy Morgan
2264e4a6d7 Fix code tests 2020-05-28 11:45:49 -04:00
Quincy Morgan
de90cc0410 Fix code tests 2020-05-19 13:21:16 -04:00
Quincy Morgan
8deec6daa9 Fix code tests 2020-05-18 10:10:35 -04: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
Quincy Morgan
c893147e15 Convert some element ids to classes to avoid collisions when embedding iD 2020-03-20 13:53:17 -07:00
Bryan Housel
e19bcb77d5 Require init() call before coreContext starts doing things
(closes #7304)
2020-01-29 19:27:12 -05:00
Bryan Housel
37557a7c98 Defer processing clicks in behaviorSelect
(closes #6028) (I hope?)

Because this click may trigger a blur event,
and the blur event may trigger a tag change,
and we really want that tag change to go to the already selected entity
and not the one that we are about to select with the click  #6028, #5878

(Be very careful entering modeSelect anywhere that might also blur a field!)
2019-05-01 14:47:29 -04: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
3bc841e95b Adjust layer ordering to draw touch targets above data layers 2018-11-09 21:48:45 -05:00
Bryan Housel
fcacdb4400 Fix hover test (requires context.hasEntity stub) 2017-12-21 11:18:06 -05:00
Bryan Housel
99a3741b0c Better isolation of services, to avoid hitting network during test runs
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
   (e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them
2017-08-09 22:04:09 -04:00
Bryan Housel
5ca4246a6d If drawing a way, don't hover on a node that was just placed
(closes #3974)
2017-04-26 13:33:21 -04:00
Bryan Housel
149cbbe350 Fix hover tests 2017-04-24 10:05:02 -04:00
Bryan Housel
6de6056c66 Don't hover sidebar or vertices when alt key disables snapping
This makes it a little more clear that the alt key is doing its job
2017-04-23 11:11:16 -04:00
Bryan Housel
4f8d772397 More improvements to select behavior re contextmenu, shiftclick, etc. 2017-02-21 22:16:17 -05:00
Bryan Housel
c18cc7577d Add flash test, avoid using sinon.useFakeTimers in tests.
sinon.useFakeTimers mocks setInterval, setTimeout, etc,
but not requestAnimationFrame, which d3 transitions rely on.
2017-02-11 00:19:49 -05:00
Bryan Housel
6ca4b13304 Store view transform and selectedIDs w/history, and undo/redo them
(closes #2204)
2016-12-10 23:25:58 -05:00
Bryan Housel
8a66b3d892 Don't enter iD.modeSelect without valid entities in selectedIDs 2016-12-09 11:32:14 -05:00
Bryan Housel
93d50b4e87 Use live bound object for imagery array, remove context.imagery() accessor
Also update documentation, closes #3359
2016-11-14 11:16:45 -05:00
Bryan Housel
f800e5afbc Remove unnecessary window parameter to Context 2016-11-10 15:19:03 -05:00
Bryan Housel
af3db7ea36 Swap url hash map order to zoom/latitude/longitude
(closes #3554)
2016-11-10 09:56:20 -05:00
Bryan Housel
87950fd472 Fix lib export, flatten names in tests and docs 2016-10-04 21:56:09 -04:00
Tom MacWright
30f24062e2 Fix hover events 2016-09-06 11:49:24 -04:00
Tom MacWright
e659bd75e9 Fix assumption that [0] contains the nodes 2016-09-04 18:19:02 -04:00
Tom MacWright
0236389611 Fix Circularize logic 2016-09-03 19:33:19 -04:00
Bryan Housel
7ca6d06254 Replace iD global with iD.Context() module (#3254) 2016-07-19 10:15:32 -04:00
Kushan Joshi
0e4b1c9d04 Add linting to spec/behavior 2016-06-15 18:26:11 +05:30
Bryan Housel
d710ed9c95 use selectAll to preserve __data__ 2016-02-24 00:54:01 -05:00
John Firebaugh
dd0e08b244 Write presets and imagery to standalone files 2014-10-23 15:52:29 -07:00
John Firebaugh
0b1ec49402 Rewrite as a separate layer 2014-09-19 14:51:44 -07:00
Vladimir Agafonkin
831f4964aa fix build and tests, add missing methods to lodash build 2013-11-22 01:19:09 +02:00
John Firebaugh
93ee3222db Fix tests 2013-06-18 12:21:56 -07:00
John Firebaugh
e5a44e9ba1 Fix tests 2013-06-17 15:49:03 -07:00
John Firebaugh
a84a3364cc selection -> selectedIDs
Overloading "selection" is a bad idea.
2013-06-03 15:48:03 -07:00
John Firebaugh
d088b39d34 Fix tests 2013-05-28 11:54:05 -07:00
John Firebaugh
884d2d0732 Add hover indicator in sidebar 2013-05-26 14:07:10 -07:00
John Firebaugh
ba08ba6109 Fix tests 2013-05-13 13:07:30 -07:00
John Firebaugh
a53d5cbb44 Optimize label hover
Add entity IDs to the element class list, so that specific
elements can be selected by ID rather than needing `filter`.
2013-05-12 11:47:48 -07:00
Ansis Brammanis
2b13de1e3f fix and add tests 2013-04-05 12:30:36 -04:00
Tom MacWright
b1eef6ad0c Fix hash tests 2013-03-13 17:56:27 -04:00
Tom MacWright
7e9a427a2b Test getPrototype, use American spellings, fix test formatting.
* Stub Lasso test
* Add cmd test
2013-03-05 17:59:50 -05:00
Ansis Brammanis
b8f3292c2b fix hash test 2013-03-05 11:18:36 -05:00
John Firebaugh
88949d6624 Fix altKey behavior with multi-step drawing (fixes #803) 2013-02-18 21:14:41 -08:00
John Firebaugh
3cce5b28dd Fix, expand iD.behavior.Select tests 2013-02-12 15:22:38 -08:00
Tom MacWright
f15191af2c Update tests 2013-02-09 18:06:35 -05:00
Ansis Brammanis
ba47d3183d Fix lasso and add it to select 2013-02-08 17:46:37 -05:00