The following rules are failing and were disabled:
* modules/ve-mw/tests:
* implicit-arrow-linebreak
Change-Id: If857233c0de24c8cf619dbb1347ebb375f3ab1ba
I'm going to assume the order in production with Chrome, as asserted
by the unit test, is the preferred order whereby negative numbers are
intended to be prepended before the positive numbers.
This came up in I6ecbd5743f3e, where this was the only unit test across
MediaWiki core and WMF gated extensions, that fails in Firefox.
It is reproducible locally with plain MW core + VisualEditor as well.
Bug: T366299
Change-Id: I6f8546e6e604cbb41e11bd2b59f8b5f19350c676
Previously, it was possible to close a dialog with active edits by
pressing the "<" button or pressing escape. A change was made to confirm
the user's intent before abandoning their changes, see Ia8935b5b1acb
This patch fixes a bug where the user's intent is always confirmed while
editing a template, even if the user has made no changes. This was
because for technical reasons we trimmed whitespace before making a
comparison with the new template case, but that caused the comparison
with the edit case to always fail because existing templates are padded
with whitespace.
This could have been solved by moving the trim operation into the new
template flow. This patch would still have been necessary to prevent
a bug if the default value had trimmable whitespace. I have opted to
keep the whitespace behaviour for edits for consistency.
Bug: T334513
Change-Id: I7b3370c86df67c36fc63a1f1d0e7004a098a1950
Same as in If6c7e85 in the TemplateWizard codebase. [a-z] is already
part of \p{L}, and [0-9] is part of \p{N}.
Change-Id: I8008ac7e504739b8f4b5fb5dd732b0deca20cefc
The promise is supposed to return a function that can be used
to lazily generate the visual diff, not the visual diff itself.
This was broken when switching to arrow functions.
Bug: T364635
Change-Id: Ifa971333aa22af346bb62d031dc20afc8979992c
This line was introduced by If59979f.
This action is only invoked from the 'safe' action when the dialog mode
is 'info' - uploads are under 'upload-info' instead - so I believe we
shouldn't end up here from an upload and whatever condition this was
guarding against is no longer a concern.
Bug: T362015
Change-Id: I6a6551eab3fb698a6ae781be4623b48e4b4c7edb
Follow-up to
I2495fe32c2d540be50450d715b049173f2f8727d
Done with the help of Matma Rex at Wikimedia Hackathon 2024.
Bug: T361103
Change-Id: Ica328233cb6172277e66d2341cfb53f87f8aff67
* Remove need for manual hacking of sub groups via "msg" strings
carefully prepended to every assertion.
* Improve CI details, by reporting the specific case that failed,
and local dev via ability to re-run each case, and reporting names
directly in the HTML Reporter and CLI summary.
* Reduce need for assert.async() and tracking of callbacks, especially
to improve failure details in case of Promise rejection.
Current logic was likely to cause a confusing timeout instead of a
clear failure if the promise ends up rejected.
QUnit propagates these as part of awaiting and asserting the test
closure's promise value (as async fn) automatically.
This approach also avoids the pitfal of a falsely passing test
when an assertion inside a done() handler was never reached.
* Use modern for-of where possible to remove need for closures and
arrow functions. Thus reducing complexity of test code, where
complexity should be kept lowest to avoid false confidence.
* Use plain for-in instead of overly complex Object.keys().forEach().
Change-Id: I934a266e75e64371081f104cfb867fb2c282c84a