Updated UI tests

This commit is contained in:
Dean 2023-09-26 15:29:40 +01:00
parent 09280166c7
commit e73ddef040
1 changed files with 7 additions and 7 deletions

View File

@ -9,34 +9,34 @@ describe("duplicate", () => {
const duplicate = duplicateName(name, names)
expect(duplicate).toBe("foo (1)")
expect(duplicate).toBe("foo 1")
})
it("with multiple existing", async () => {
const names = ["foo", "foo (1)", "foo (2)"]
const names = ["foo", "foo 1", "foo 2"]
const name = "foo"
const duplicate = duplicateName(name, names)
expect(duplicate).toBe("foo (3)")
expect(duplicate).toBe("foo 3")
})
it("with mixed multiple existing", async () => {
const names = ["foo", "foo (1)", "foo (2)", "bar", "bar (1)", "bar (2)"]
const names = ["foo", "foo 1", "foo 2", "bar", "bar 1", "bar 2"]
const name = "foo"
const duplicate = duplicateName(name, names)
expect(duplicate).toBe("foo (3)")
expect(duplicate).toBe("foo 3")
})
it("with incomplete sequence", async () => {
const names = ["foo", "foo (2)", "foo (3)"]
const names = ["foo", "foo 2", "foo 3"]
const name = "foo"
const duplicate = duplicateName(name, names)
expect(duplicate).toBe("foo (1)")
expect(duplicate).toBe("foo 1")
})
})
})