mirror of
https://github.com/outline/outline.git
synced 2026-05-01 06:59:55 -05:00
bbe6df19ea
Add removeIndexCollision tests
17 lines
609 B
TypeScript
17 lines
609 B
TypeScript
import { buildCollection } from "@server/test/factories";
|
|
import removeIndexCollision from "./removeIndexCollision";
|
|
|
|
describe("removeIndexCollision", () => {
|
|
it("should return the next available index", async () => {
|
|
const collection = await buildCollection({ index: "P" });
|
|
expect(
|
|
await removeIndexCollision(collection.teamId, collection.index!)
|
|
).toEqual("h");
|
|
});
|
|
|
|
it("should return existing index if no collision", async () => {
|
|
const collection = await buildCollection({ index: "%P" });
|
|
expect(await removeIndexCollision(collection.teamId, "n")).toEqual("n");
|
|
});
|
|
});
|