mediawiki-extensions-Visual.../modules/ve-mw/tests
Bartosz Dziewoński 461c76981f Rewrite mw.libs.ve.getTargetDataFromHref with URL API
At first I was going for a more minimal replacement of mw.Uri with URL,
until I discovered that this code depends on a mw.Uri bug that would be
difficult to replicate:

  // Expected: Relative URLs are accepted
  new mw.Uri( '/foo' ).toString() // => 'https://localhost/foo'
  // Expected: Protocol is optional
  new mw.Uri( 'example.com/foo' ).toString() // => 'https://example.com/foo'
  // Unexpected: Treated as empty domain with no protocol rather than relative URL
  new mw.Uri( './foo' ).toString() // => 'https://./foo'

So I went for a bigger rewrite to preserve the intent rather than the
exact logic.

I had to change some test cases to use more realistic fake data. They
previously relied on bugs in our URL handling to pass despite the base
URLs being incorrect, particularly for non-short URLs (see T270219).
In my testing non-short URLs behave the same as before in practice.

Depends-On: I07a8c097dba0f5572c0aedf4febdf1434063ea6f
Bug: T325249
Change-Id: I232361266c1dda795b88018c3aaa3d9ecbe42b93
2023-01-23 14:59:23 +00:00
..
ce Update VE core submodule to master (b7ff5aac0) 2023-01-23 15:57:59 +01:00
dm Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
init/targets Store copyright message in auto-save data 2022-04-07 23:03:37 +00:00
preinit Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
ui Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
.eslintrc.json Update eslint-config-wikimedia to 0.24.0 2023-01-18 14:39:04 +00:00
ve.test.utils.js DesktopArticleTarget tests: Mock config using QUnit.newMwEnvironment 2022-03-04 13:36:22 +00:00