Fix up broken js-tests.
Review Request #10291 — Created Oct. 29, 2018 and submitted
We had a few JavaScript unit tests which were broken, with two specific
causes:
- For the
ScrollManagerView
, chrome has been doing sub-pixel
scrolling, which broke our tests. I've sprinkled someMath.round()
calls around to fix this. - For the
ReviewReplyEditorModel
, an update to Backbone had broken
some tests which artificially assign an ID in order forisNew()
to
returnfalse
. The newerisNew()
checks theid
attribute
instead of the value in the object.
Ran js-tests.
-
-
If we call
set('id', ...)
instead, this will take care of both. We should be doing that for IDs going forward. -
-
I'm not sure it's correct to round it here. I can see rounding for the tests, but I think interfering with original values here will throw off calculations. Or if we need to round, doing it when applying the new location might be better.
- Commit:
-
0c901451cf52d11e8b35c0fedbe0be5a26be5f32dcd679c4a983b080b796f2e14e0b16c1707831f0
Checks run (2 succeeded)
flake8
passed.
JSHint
passed.