mediawiki-extensions-Popups/tests/node-qunit
Stephen Niedzielski 9114981380 Update: show placeholder preview for more failures
Functional changes

- Show the default / error preview for all extract request failures
  except those due to network circumstances (such as CORS) or no
  connectivity (offline). Previously, the error preview was displayed
  only for missing pages.

- FETCH_COMPLETE was previously only dispatched after FETCH_END. Now
  it's also dispatched after FETCH_FAILED. The additional "fetch
  complete" is not expected to impact logging. The states of success
  are: START, END, COMPLETE. The new failure states are consistent with
  success: START, FAILED, COMPLETE.

Testing

Errors may be stimulated in a number of ways including:

- Timeout: add a timeout field to RESTBaseGateway /
  MediaWikiGateway.fetch().

  http://api.jquery.com/jquery.ajax/

- Bad request: change MediaWikiGateway.fetch's action field to
  `Math.random() > 0.5 ? 'query' : 'fail'` and RESTBaseGateway.fetch's
  url field to
  `RESTBASE_ENDPOINT + ( Math.random() > 0.5 ? encodeURIComponent( title ) : '%%%' )`.

- Desired Gateway can be configured in Gateway#createGateway().

- Note: T184534 describes a circumstance where cached previews may not
  appear when offline. Disable browser caching to avoid confusion.

Bug: T183151
Bug: T184534
Change-Id: I7332284da0e0fb1ecd234a6f1e146ebd9ad8d81f
2018-01-16 18:44:00 -06:00
..
changeListeners Schema:Popups - use revision 17430287 2017-11-17 12:49:22 -05:00
gateway Fix: preview page URL for 404 RESTBase responses 2018-01-16 18:36:48 -06:00
instrumentation Popups A/B test infrastructure 2017-08-17 21:07:07 +00:00
integrations Hygiene: make integrations/mwpopups pure 2017-08-09 16:07:08 +02:00
preview Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
reducers Update: show placeholder preview for more failures 2018-01-16 18:44:00 -06:00
ui Update: missing preview copy 2018-01-16 18:36:54 -06:00
actions.test.js Update: show placeholder preview for more failures 2018-01-16 18:44:00 -06:00
changeListener.test.js Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
container.test.js Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
counts.test.js getPreviewCountBucket should return unknown when no bucket is found 2017-08-15 16:12:26 +02:00
experiments.test.js Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
formatter.test.js build: Update eslint and other linters 2017-10-09 15:56:15 +01:00
getUserBucket.test.js Popups A/B test infrastructure 2017-08-17 21:07:07 +00:00
integration.test.js Update: show placeholder preview for more failures 2018-01-16 18:44:00 -06:00
isEnabled.test.js Popups A/B test infrastructure 2017-08-17 21:07:07 +00:00
previewBehavior.test.js Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
run.js Use EcmaScript modules instead of common.js modules 2017-07-31 23:05:44 +00:00
stubs.js Fix: preview page URL for 404 RESTBase responses 2018-01-16 18:36:48 -06:00
title.test.js build: Update eslint and other linters 2017-10-09 15:56:15 +01:00
userSettings.test.js if preview count stored in localStorage is not a number override it 2017-08-17 18:29:56 +02:00
wait.test.js Hygiene: Use promises A/A+ everywhere 2017-08-22 13:36:00 +02:00