diff --git a/packages/ui/src/components/Pagination/helpers.test.ts b/packages/ui/src/components/Pagination/helpers.test.ts index d5e33ef08..806fbbf3f 100644 --- a/packages/ui/src/components/Pagination/helpers.test.ts +++ b/packages/ui/src/components/Pagination/helpers.test.ts @@ -2,9 +2,12 @@ import { describe, expect, it } from "vitest"; import { range } from "./helpers"; describe("Helpers / Range", () => { - it("should return the empty list, given start >= end", () => { + it("should return the empty list, given start > end", () => { expect(range(20, 10)).toEqual([]); - expect(range(10, 10)).toEqual([]); + }); + + it("should return a single element when start equals end", () => { + expect(range(10, 10)).toEqual([10]); }); it("should return every number from start to end, inclusive, given start < end", () => { diff --git a/packages/ui/src/components/Pagination/helpers.ts b/packages/ui/src/components/Pagination/helpers.ts index 54fc9441c..3840bf5fd 100644 --- a/packages/ui/src/components/Pagination/helpers.ts +++ b/packages/ui/src/components/Pagination/helpers.ts @@ -10,7 +10,7 @@ * ``` */ export function range(start: number, end: number): number[] { - if (start >= end) { + if (start > end) { return []; }