mediawiki-extensions-Popups/tests/node-qunit
Sam Smith d4caff9774 rest: Don't scale unscalable thumbnails
If the image isn't an SVG then it shouldn't be scaled past its original
dimensions. Handle the case where the requested thumbnail can't be
generated on the server as the original is too small ( < 320px,
currently [0]) in the same way.

Moreover, if the image happens to have the exact dimensions that we're
requesting (300px or 600px wide, currently [1]), then use the original
image to avoid unnecessary work/pressure on caches.

Supporting changes:
* Update the SVG_RESTBASE_RESPONSE fixture to use the extension returned
  by RESTBase (and the PageImages extension) for the thumbnail:
  .svg.png.

[0] https://github.com/wikimedia/restbase/blob/master/v1/summary.yaml#L121
[1] https://github.com/wikimedia/mediawiki-extensions-Popups/blob/master/src/constants.js#L2

Bug: T156800
Change-Id: I5d0aa161e80869e4b4f5425d906d1e753047a3a3
2017-03-08 18:44:23 +01:00
..
changeListeners Tests: Migrate changeListeners/render.test.js to node-qunit 2017-02-22 12:14:05 +01:00
gateway rest: Don't scale unscalable thumbnails 2017-03-08 18:44:23 +01:00
preview Test: Migrate preview/model.test.js to node-qunit 2017-02-20 20:01:01 +01:00
reducers Test: Migrate reducers/eventLogging.test.js to node-qunit 2017-02-20 20:01:01 +01:00
actions.test.js Tests: Migrate {integration,actions}.test.js to node qunit 2017-02-27 18:17:28 +01:00
changeListener.test.js Test: Migrate changeListener.test.js to node-qunit 2017-02-20 20:01:01 +01:00
counts.test.js Set up qunit running in node to migrate tests to commonjs 2017-02-20 20:01:01 +01:00
integration.test.js Tests: Migrate {integration,actions}.test.js to node qunit 2017-02-27 18:17:28 +01:00
isEnabled.test.js Allow bucketing anons 2017-03-01 10:45:32 +00:00
previewBehavior.test.js Tests: Migrate previewBehavior.test.js to node qunit 2017-02-22 12:14:07 +01:00
schema.test.js Tests: Extract createStubMap 2017-03-01 12:40:42 +01:00
settingsDialog.test.js Tests: Migrate settingsDialog.test.js to node qunit 2017-02-22 12:14:07 +01:00
stubs.js Tests: Extract createStubMap 2017-03-01 12:40:42 +01:00
userSettings.test.js Tests: Migrate userSettings.test.js to node-qunit 2017-03-01 12:47:07 +01:00
wait.test.js Test: Migrate wait.test.js to node-qunit 2017-02-22 12:13:37 +01:00