| ... | ... | @@ -60,7 +60,6 @@ vi.mock("~/lib/openPullRequestLink", () => ({ |
| 60 | 60 | import ChatMarkdown, { |
| 61 | 61 | canUseMarkdownFileShellActions, |
| 62 | 62 | hasMarkdownFilePrimaryAction, |
| 63 | | orderedListGutterStyle, |
| 64 | 63 | shouldUseMarkdownFileBrowserPrimaryAction, |
| 65 | 64 | } from "./ChatMarkdown"; |
| 66 | 65 | |
| ... | ... | @@ -640,47 +639,6 @@ describe("shouldUseMarkdownFileBrowserPrimaryAction", () => { |
| 640 | 639 | }); |
| 641 | 640 | }); |
| 642 | 641 | |
| 643 | | describe("orderedListGutterStyle", () => { |
| 644 | | it("leaves the default gutter alone for single-digit lists", () => { |
| 645 | | expect(orderedListGutterStyle(9, undefined)).toBeUndefined(); |
| 646 | | }); |
| 647 | | |
| 648 | | it("widens the gutter for two-digit lists", () => { |
| 649 | | expect(orderedListGutterStyle(99, undefined)).toEqual({ "--list-gutter": "3ch" }); |
| 650 | | }); |
| 651 | | |
| 652 | | it("widens the gutter for a two-digit list that starts above 1", () => { |
| 653 | | // start=50 + 49 items => last marker is "98", still two digits. |
| 654 | | expect(orderedListGutterStyle(49, 50)).toEqual({ "--list-gutter": "3ch" }); |
| 655 | | }); |
| 656 | | |
| 657 | | it("widens the gutter once the last marker reaches three digits", () => { |
| 658 | | // item 100 is the bug from #6512: a 100-item list starting at 1. |
| 659 | | expect(orderedListGutterStyle(100, undefined)).toEqual({ "--list-gutter": "4ch" }); |
| 660 | | }); |
| 661 | | |
| 662 | | it("accounts for a non-default start attribute", () => { |
| 663 | | // start=95 + 9 items => last marker is "103", three digits. |
| 664 | | expect(orderedListGutterStyle(9, 95)).toEqual({ "--list-gutter": "4ch" }); |
| 665 | | expect(orderedListGutterStyle(5, "999995")).toEqual({ "--list-gutter": "7ch" }); |
| 666 | | }); |
| 667 | | |
| 668 | | it("scales further for four-digit markers", () => { |
| 669 | | expect(orderedListGutterStyle(1000, undefined)).toEqual({ "--list-gutter": "5ch" }); |
| 670 | | }); |
| 671 | | |
| 672 | | it("uses the widest marker and includes a negative start's minus sign", () => { |
| 673 | | expect(orderedListGutterStyle(1001, -1000)).toEqual({ "--list-gutter": "6ch" }); |
| 674 | | expect(orderedListGutterStyle(3, -15)).toEqual({ "--list-gutter": "4ch" }); |
| 675 | | expect(orderedListGutterStyle(3, -5)).toEqual({ "--list-gutter": "3ch" }); |
| 676 | | }); |
| 677 | | |
| 678 | | it("treats a missing/zero item count as a single item", () => { |
| 679 | | expect(orderedListGutterStyle(0, undefined)).toBeUndefined(); |
| 680 | | expect(orderedListGutterStyle(0, 100)).toEqual({ "--list-gutter": "4ch" }); |
| 681 | | }); |
| 682 | | }); |
| 683 | | |
| 684 | 642 | describe("ChatMarkdown Windows file links", () => { |
| 685 | 643 | const environmentId = EnvironmentId.make("env-windows"); |
| 686 | 644 | |