mirror of
https://github.com/rustfs/console.git
synced 2026-08-29 03:52:28 +08:00
18 lines
772 B
JavaScript
18 lines
772 B
JavaScript
import test from "node:test"
|
|
import assert from "node:assert/strict"
|
|
import fs from "node:fs"
|
|
|
|
test("ApiClient exposes URL resolution against its configured base URL", () => {
|
|
const source = fs.readFileSync("lib/api-client.ts", "utf8")
|
|
|
|
assert.match(source, /resolveUrl\(url: string\): string/)
|
|
assert.match(source, /new URL\(url, this\.config\?\.baseUrl\)\.toString\(\)/)
|
|
})
|
|
|
|
test("object bulk download resolves relative download URLs through the API client", () => {
|
|
const source = fs.readFileSync("components/object/list.tsx", "utf8")
|
|
|
|
assert.match(source, /normalizeObjectZipDownloadUrl\(response\.download_url, api\.resolveUrl\("\/"\)\)/)
|
|
assert.doesNotMatch(source, /normalizeObjectZipDownloadUrl\(response\.download_url, window\.location\.origin\)/)
|
|
})
|