Merge pull request #18780 from flying-musk/test-url-state-complex-promql
Some checks are pending
buf.build / lint and publish (push) Waiting to run
CI / Go tests (push) Waiting to run
CI / More Go tests (push) Waiting to run
CI / Go tests for 32-bit x86 (push) Waiting to run
CI / Go tests for Prometheus upgrades and downgrades (push) Waiting to run
CI / Go tests with previous Go version (push) Waiting to run
CI / UI tests (push) Waiting to run
CI / Go tests on Windows (push) Waiting to run
CI / Mixins tests (push) Waiting to run
CI / Compliance testing (push) Waiting to run
CI / Build Prometheus for common architectures (push) Waiting to run
CI / Build Prometheus for all architectures (push) Waiting to run
CI / Report status of build Prometheus for all architectures (push) Blocked by required conditions
CI / Check generated parser (push) Waiting to run
CI / golangci-lint (push) Waiting to run
CI / fuzzing (push) Waiting to run
CI / codeql (push) Waiting to run
CI / Publish main branch artifacts (push) Blocked by required conditions
CI / Publish release artefacts (push) Blocked by required conditions
CI / Publish UI on npm Registry (push) Blocked by required conditions
govulncheck / Run govulncheck (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

ui: cover PromQL URL-sensitive characters in URL state test
This commit is contained in:
Julius Volz 2026-05-24 11:24:06 +02:00 committed by GitHub
commit 01822f2a7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -573,6 +573,18 @@ describe("encode and decode roundtrip", () => {
expect(decoded[0].showTree).toBe(original.showTree);
});
test("roundtrip preserves PromQL expressions with URL-sensitive characters", () => {
const expr =
'sum by (job) (rate(http_requests_total{status!="500",handler=~"/api/v1/.+"}[5m]))';
const original = createPanel({ expr });
const encoded = encodePanelOptionsToURLParams([original]);
const decoded = decodePanelOptionsFromURLParams(encoded.toString());
expect(decoded).toHaveLength(1);
expect(decoded[0].expr).toBe(expr);
});
test("roundtrip preserves visualizer settings", () => {
const original = createPanel({
visualizer: {