// The Lucia project.
// Copyright 2026-2026 DSP, inc.  All rights reserved.
// Authors:
//   imacat.yang@dsp.im (imacat), 2026/03/08

import { describe, expect, it } from "vitest";
import { encodeReturnTo, decodeReturnTo } from "@/utils/returnToEncoding";

describe("returnToEncoding", () => {
  it("round-trips ASCII paths", () => {
    const original = "/discover/log/1/map?view=summary#node-2";
    const encoded = encodeReturnTo(original);
    expect(decodeReturnTo(encoded)).toBe(original);
  });

  it("round-trips Unicode paths without throwing", () => {
    const original = "/files?keyword=流程圖#節點";
    const encoded = encodeReturnTo(original);
    expect(decodeReturnTo(encoded)).toBe(original);
  });
});
