mirror of
https://github.com/rustfs/console.git
synced 2026-08-28 19:47:21 +08:00
16 lines
646 B
JavaScript
16 lines
646 B
JavaScript
import test from "node:test"
|
|
import assert from "node:assert/strict"
|
|
import { buildModuleBucketPath } from "../../lib/module-bucket-route.js"
|
|
|
|
test("buildModuleBucketPath links a bucket to a module detail route", () => {
|
|
assert.equal(buildModuleBucketPath("/lifecycle", "photos"), "/lifecycle?bucket=photos")
|
|
})
|
|
|
|
test("buildModuleBucketPath encodes bucket names in query params", () => {
|
|
assert.equal(buildModuleBucketPath("/events", "logs archive"), "/events?bucket=logs+archive")
|
|
})
|
|
|
|
test("buildModuleBucketPath returns module root when bucket is empty", () => {
|
|
assert.equal(buildModuleBucketPath("/replication", ""), "/replication")
|
|
})
|