mediawiki-extensions-Popups/tests/node-qunit
Piotr Miazga 2527f931a2 Properly handle catch() when calling gateway fetch.
Previous implementation did not pass the `result` variable
to the catch() statement. Because of that every execution that
ended with exception inside fetch() statement was threated as
not a network exception and tried to present the null preview.

Changes:
 - properly handle data returned by rejected fetch promise
 - chaged the big if (result && result....) into something easier
 to read
 - pass Error object instead of 'http' string
 - Restbase can return exception, it doesn't have to handle the 404
 errors by itself, it's already taken care in the catch() logic
 - fixed unit tests to reflect new logic in restbase gateway

Bug: T199482
Change-Id: Ibb30fc58248623d9ad4c5388a5b2ff9b387e01de
2018-07-13 00:02:59 +02:00
..
changeListeners Hygiene: replace QUnit assert.equal with strictEqual() 2018-06-18 19:48:16 +00:00
gateway Properly handle catch() when calling gateway fetch. 2018-07-13 00:02:59 +02:00
instrumentation Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
integrations Hygiene: replace QUnit assert.equal with strictEqual() 2018-06-18 19:48:16 +00:00
preview Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
reducers Update: cancel unused HTTP requests in flight 2018-07-04 13:48:14 -05:00
ui Hygiene: consistently refer to globals directly 2018-07-09 08:46:40 -05:00
actions.test.js Update: cancel unused HTTP requests in flight 2018-07-04 13:48:14 -05:00
changeListener.test.js Update: cancel unused HTTP requests in flight 2018-07-04 13:48:14 -05:00
container.test.js Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
counts.test.js Hygiene: replace QUnit assert.equal with strictEqual() 2018-06-18 19:48:16 +00:00
experiments.test.js Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
formatter.test.js Hygiene: consistently refer to globals directly 2018-07-09 08:46:40 -05:00
getPageviewTracker.test.js Truncate source_url to max 1000 characters 2018-06-28 14:30:42 -07:00
integration.test.js Update: cancel unused HTTP requests in flight 2018-07-04 13:48:14 -05:00
isEnabled.test.js Hygiene: replace QUnit assert.equal with strictEqual() 2018-06-18 19:48:16 +00:00
previewBehavior.test.js Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
run.js Hygiene: move SVG string to file 2018-03-14 12:04:28 -07:00
stubs.js Hygiene: favor string templates over concatenation 2018-03-21 08:05:55 -05:00
title.test.js Hygiene: consistently refer to globals directly 2018-07-09 08:46:40 -05:00
userSettings.test.js Hygiene: add assertion messages 2018-05-08 15:55:23 -05:00
wait.test.js Update: cancel unused HTTP requests in flight 2018-07-04 13:48:14 -05:00