mediawiki-extensions-Popups/tests/node-qunit
joakin 010a4d91a6 Hygiene: Simplify gateways
gateway/*/rest were copies of gateway/restProvider just passing
a different provider. Docs were the same, they were untested, and
looking at them they seemed like unnecessary abstraction.

This patch removes the plain vs html structure, and separates gateways
like before, by endpoint.

There is a light utility in gateway/restFormatters.js that adapts the
call from the rest gateway to use formatters.js functions. It needs
testing, that I'll add in the next patch.

The flow for creating a gateway ends up as follows:

1. index.js calls gateway/index#createGateway( mw.config )
2. createGateway chooses based on wgPopupsGateway and invokes
  * mediawiki.js#createMediaWikiApiGateway or
  * rest.js#createRESTBaseGateway w/ restFormatters.js#parsePlainTextResponse or
  * rest.js#createRESTBaseGateway w/ restFormatters.js#parseHTMLResponse

Changes:
* Removed src/gateway/{plain,html}/rest.js
  * Extracted formatter functions to src/gateway/restFormatters.js
* src/gateway/plain/mediawiki.js -> src/gateway/mediawiki.js
         * tests/node-qunit/gateway/plain/mediawiki.test.js ->
           tests/node-qunit/gateway/mediawiki.test.js
* gateway/restProvider{,.test}.js -> gateway/rest{,.test}.js
* Change gateway/index.js#createGateway to properly call the rest
  gateways with the rest formatters

Bug: T165018
Change-Id: Ia75695dfc192aad5bc581a68882514bad6c29646
2017-06-16 14:49:59 +02:00
..
changeListeners Clear interaction after an event for it is logged in EL 2017-05-16 11:25:41 +02:00
gateway Hygiene: Simplify gateways 2017-06-16 14:49:59 +02:00
preview Extract rendering/parsing mediawiki responses into separate class 2017-06-09 18:34:25 +02:00
reducers eventLogging: Add missing properties to "tapped settings cog" event 2017-06-07 10:13:23 +01:00
actions.test.js Use delegated events in container 2017-06-08 12:31:06 -07:00
changeListener.test.js Test: Migrate changeListener.test.js to node-qunit 2017-02-20 20:01:01 +01:00
container.test.js Add service container 2017-05-23 06:25:44 +01:00
counts.test.js Set up qunit running in node to migrate tests to commonjs 2017-02-20 20:01:01 +01:00
experiments.test.js i13n: Extract experiments module 2017-06-14 11:04:32 -07:00
formatter.test.js Implement html/rest.js gateway which handles HTML Restbase responses 2017-06-13 20:19:05 +02:00
integration.test.js Use delegated events in container 2017-06-08 12:31:06 -07:00
isEnabled.test.js Hygiene: QUnit setup -> beforeEach & teardown -> afterEach 2017-04-26 12:34:12 +02:00
previewBehavior.test.js Hygiene: QUnit setup -> beforeEach & teardown -> afterEach 2017-04-26 12:34:12 +02:00
renderer.js Extract rendering/parsing mediawiki responses into separate class 2017-06-09 18:34:25 +02:00
schema.test.js Hygiene: Tidy up QUnit references 2017-05-04 15:53:44 +01:00
settingsDialog.test.js Tests: Migrate settingsDialog.test.js to node qunit 2017-02-22 12:14:07 +01:00
statsvInstrumentation.test.js i13n: Extract experiments module 2017-06-14 11:04:32 -07:00
stubs.js actions/rest: Use DB-key version of title 2017-06-12 11:22:55 +01:00
title.test.js Add title#isValid 2017-06-08 12:29:33 -07:00
userSettings.test.js Hygiene: QUnit setup -> beforeEach & teardown -> afterEach 2017-04-26 12:34:12 +02:00
wait.test.js Test: Migrate wait.test.js to node-qunit 2017-02-22 12:13:37 +01:00