Commit Graph

112 Commits

Author SHA1 Message Date
Quincy Morgan
73e64b2d7e Update code test 2020-01-18 12:27:50 -05:00
Quincy Morgan
43cd46f046 Prevent Chrome autofill of recent values in the Allowed Access inputs (close #6414) 2019-05-24 09:30:06 -04:00
Bryan Housel
69a25fd6aa Move locking code from input and localized up to uiField
Also adjust styles some more for wikidata tagged items
2019-05-20 17:50:50 -04:00
Bryan Housel
ff1eea43a8 Remove Google Analytics, also actually export iD.utilDetect 2019-05-02 19:12:39 -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
Quincy Morgan
e3e3fd1ad3 Fix Wikipedia field test 2019-04-15 15:32:57 -07:00
Bryan Housel
26368522c9 Batch changes from raw tag editor so blur/remove tag don't conflict
(closes #5878)
2019-02-10 22:08:13 -05:00
Bryan Housel
09f7f9189f Fix field tests to run with minimal set of presets 2019-01-30 16:29:27 -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
b9444ab991 Restore hand cursor on dropdown carat
(closes #5769)

This change allows pointer events to flow to the caret, and forwards
them back to the combo input.  Also renames several event handlers
for clarity, and increases the double-click detection threshold.
2019-01-26 13:22:31 -05:00
Bryan Housel
55715a4827 Try to dispatch an accept event on blur
(re: #5752 - but does not close it)
2019-01-25 14:47:17 -05:00
Bryan Housel
0c7b9a631e Improve combobox event handling and avoid overwriting typed data
(closes #5722, re: #5637, re: #5618)

dispatched with a value() string instead of a datum, which
causes issues for code expecting a datum always.
(such as localized.js brand picker or "Add Field" combo)

Fix for this coming in next commit.
2019-01-22 22:26:27 -05:00
Bryan Housel
19a8f5c47c Remove test that only works if we can reliably simulate clicks
Previously the combo showed immediately on mousedown, now it
shows on mouseup after some slight delay.
2019-01-18 23:34:59 -05:00
Bryan Housel
1ec5b708fc Restore default click behaviors on mousedown of a combobox
(closes #5732)
2019-01-18 23:23:35 -05:00
Bryan Housel
495793929f Skip wikidata field test, too time sensitive to work reliably 2018-12-27 12:06:53 -05:00
Max Grossman
e3407d4168 do not use mouseover, use mousedown!
ref #5596
2018-12-20 09:05:23 -05:00
Bryan Housel
222b3f1b04 Don't render contents of collapsed sections
(speeds things up if raw tag editor is hidden)
2018-12-11 15:19:29 -05:00
Bryan Housel
6732ca6eda Comboboxes no longer show on focus.. update tests 2018-12-11 01:19:51 -05:00
Bryan Housel
15a54cab17 Use context.container instead of passing it in 2018-12-10 14:14:27 -05:00
Bryan Housel
e5dedeff8b Move lib/d3.combobox.js -> ui/combobox.js
As with other things from this lib/ folder, little original code remains
and turning these things into reusable d3 plugins is not a priority.
2018-12-10 12:38:21 -05:00
Tom Hughes
d617d9c588 Fix wikipedia UI tests to mock XHR instead of JSONP 2018-07-04 17:07:27 +01:00
Bryan Housel
f247bd1e66 Move icon code into uiFlash, default flash icon to icon-no
Previously it was up to the caller to draw whatever they want into the
footer flash.  With this change, uiFlash creates an icon and a text, so
the caller doesn't need to do as much work.
2017-12-05 23:41:34 -05:00
Bryan Housel
b3842d97f4 Remove lodash from the test suite
(closes #4378)
2017-10-18 14:37:39 -04: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
b7958415b3 Don't remove all the divs under body when testing 2017-08-09 22:02:58 -04:00
Bryan Housel
e8bd6bff6c Fix wikidata clearing, failed lookup when entity no longer selected
(closes #3987)
(closes #3684)
(related #3929)
2017-06-23 16:37:13 -04:00
Bryan Housel
3b54743f86 Add more d3.timerFlush to avoid false test failures (hopefully) 2017-04-24 16:15:41 -04:00
Bryan Housel
b803730a4b More modal and confirm tests, d3.timerFlush to avoid false failures 2017-04-24 14:57:47 -04:00
Bryan Housel
5f44c9a00a Add combobox menus to id-container instead of document.body
(re: https://github.com/openstreetmap/iD/issues/3925#issuecomment-290718356)
2017-03-31 13:44:55 -04:00
Bryan Housel
48d1b0b28e .wiki-link is now a button so we can't test href attribute 2017-03-22 02:50:27 -04:00
Bryan Housel
e9b8b743e7 Update sinon and sinon-chai dependencies 2017-03-21 16:25:29 -04:00
Bryan Housel
3908da03cf Fix styling of flash and footer and use absolutely positioned divs
Also fix flash tests
2017-02-17 00:23:24 -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
9b7d79a3fe Use live bound object for presets object, change context.presets() getter 2016-11-14 15:44:02 -05:00
Bryan Housel
f800e5afbc Remove unnecessary window parameter to Context 2016-11-10 15:19:03 -05:00
Bryan Housel
b2c8f72c95 no-native-reassign -> no-global-assign 2016-10-29 14:42:04 -04:00
Bryan Housel
e83b2ea2be Allow delete key without modifier as shortcut for deleting
(closes #3455)

Also fixed a minor bug in `iD.uiCmd` that was causing keyboard shortcuts
like '⌘⌫' to convert to 'Ctrl+Backspace+'  (note extra trailing '+')
It affected only the tooltip display, not the key event binding.
2016-10-24 23:57:44 -04:00
Bryan Housel
1d03414b80 Allow forced utilDetect(), useful for testing 2016-10-18 21:56:24 -04:00
Bryan Housel
87950fd472 Fix lib export, flatten names in tests and docs 2016-10-04 21:56:09 -04:00
Bryan Housel
4522d8f89a Add some namespaces to test labels 2016-09-12 21:40:00 -04:00
Bryan Housel
482b4d7cbe mock userAgents in a way that works in both Phantom and real browsers 2016-09-09 14:59:55 -04:00
Tom MacWright
a28e24bb4c Fix lints 2016-09-06 17:29:03 -04:00
Tom MacWright
6bfe6a8640 Down to 7 test failures 2016-09-06 11:16:47 -04:00
Tom MacWright
2b366b5f78 Fix access field 2016-09-06 10:06:28 -04:00
Tom MacWright
92f2908ffe Fix wikipedia 2016-09-05 21:48:22 -04:00
Tom MacWright
6189af9b47 fix localized 2016-09-05 21:40:41 -04:00
Tom MacWright
cb50b7b03a Fix raw tag editor tests 2016-09-05 21:30:21 -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
5a045933c6 Rename confirm -> uiconfirm and import to save.js
(closes #3373)
2016-08-24 16:03:23 -04:00