mediawiki.api.upload: Fix test assumption about <iframe>
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 24 Mar 2018 04:17:42 +0000 (21:17 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 24 Mar 2018 04:17:42 +0000 (21:17 -0700)
commit80791024f1c3e16f8d555734809cc8c522e6ffcf
tree5620934aaf8b1fffb8ab8b194167b3449191db21
parent07ab8c1c04917f4570718993c62e3a7904d96527
mediawiki.api.upload: Fix test assumption about <iframe>

This test failed when another iframe exists before the one added
during the test, because it uses $('iframe').prop() to access the
property, which, if matching multiple iframes, will use the first
one on the page.

Make it slightly less bad, by specifying that it should use the
last one instead, given we know that mediawiki/api/upload.js appends
to document.body.

Really, though, it should have a more reliable method of obtaining
the references to these nodes.

Change-Id: I0f0723668fa3366fb8228a7a3e8a4cb03ff87d27
tests/qunit/suites/resources/mediawiki.api/mediawiki.api.upload.test.js