-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3907 from voxel51/release/v0.23.1
Release/v0.23.1
- Loading branch information
Showing
23 changed files
with
401 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { resolveURL } from "./utils"; | ||
|
||
describe("resolves datasets", () => { | ||
it("resolves to /", () => { | ||
expect( | ||
resolveURL({ | ||
currentPathname: "/datasets/my-dataset", | ||
currentSearch: "", | ||
nextDataset: null, | ||
}) | ||
).toBe("/"); | ||
expect( | ||
resolveURL({ currentPathname: "/datasets/my-dataset", currentSearch: "" }) | ||
).toBe("/datasets/my-dataset"); | ||
}); | ||
}); | ||
|
||
describe("resolves wih proxy", () => { | ||
it("resolves to /", () => { | ||
expect( | ||
resolveURL({ | ||
currentPathname: "/datasets/my-dataset", | ||
currentSearch: "?proxy=/my/proxy", | ||
nextDataset: null, | ||
}) | ||
).toBe(`/my/proxy?proxy=${encodeURIComponent("/my/proxy")}`); | ||
expect( | ||
resolveURL({ | ||
currentPathname: "/my/proxy/datasets/my-dataset", | ||
currentSearch: "?proxy=/my/proxy", | ||
}) | ||
).toBe( | ||
`/my/proxy/datasets/my-dataset?proxy=${encodeURIComponent("/my/proxy")}` | ||
); | ||
}); | ||
}); | ||
|
||
describe("resolves views", () => { | ||
it("throws error", () => { | ||
expect(() => | ||
resolveURL({ | ||
currentPathname: "", | ||
currentSearch: "", | ||
nextDataset: null, | ||
nextView: "view", | ||
}) | ||
).toThrowError(); | ||
}); | ||
|
||
it("throws error", () => { | ||
expect(() => | ||
resolveURL({ | ||
currentPathname: "", | ||
currentSearch: "", | ||
nextView: "view", | ||
}) | ||
).toThrowError(); | ||
}); | ||
|
||
it("resolves with saved view", () => { | ||
expect( | ||
resolveURL({ | ||
currentPathname: "/datasets/my-dataset", | ||
currentSearch: "", | ||
nextDataset: "my-dataset", | ||
nextView: "view", | ||
}) | ||
).toBe(`/datasets/my-dataset?view=view`); | ||
}); | ||
}); | ||
|
||
describe("resolves current", () => { | ||
it("does not change location", () => { | ||
expect( | ||
resolveURL({ | ||
currentPathname: "/datasets/my-dataset", | ||
currentSearch: "?view=view", | ||
}) | ||
).toBe("/datasets/my-dataset?view=view"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.