mediawiki.Uri: Add another test for arrayParams
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 28 Aug 2019 12:17:13 +0000 (14:17 +0200)
committerKrinkle <krinklemail@gmail.com>
Thu, 29 Aug 2019 02:58:06 +0000 (02:58 +0000)
Verify that the added handling is correctly conditional.

Bug: T231382
Change-Id: I71b834c1c0a7bdaf28d990eafd4ce5d70a55e141

tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js

index 013fb0d..9230ab7 100644 (file)
                        'Parse an ftp URI correctly with user and password'
                );
 
+               uri = new mw.Uri( 'http://example.com/?foo[1]=b&foo[0]=a&foo[]=c' );
+
+               assert.deepEqual(
+                       uri.query,
+                       {
+                               'foo[1]': 'b',
+                               'foo[0]': 'a',
+                               'foo[]': 'c'
+                       },
+                       'Array query parameters parsed as normal with arrayParams:false'
+               );
+
                assert.throws(
                        function () {
                                return new mw.Uri( 'glaswegian penguins' );