mediawiki-extensions-Visual.../modules/ve-mw/tests/dm
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
..
annotations Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
models Merge "Change TransclusionModel.nextUniquePartId() to return a string" 2022-06-14 08:30:09 +00:00
nodes
ve.dm.Converter.test.js Update VE core submodule to master (b7ff5aac0) 2023-01-23 15:57:59 +01:00
ve.dm.Document.test.js
ve.dm.mwExample.js Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
ve.dm.SurfaceFragment.test.js Update VE core submodule to master (b7ff5aac0) 2023-01-23 15:57:59 +01:00