test(FN-4264): add file path wrapping regression coverage
- Add a dashboard filePathLinkify regression test for long file path buttons - Verify file path links render with wrapping-friendly computed styles - Guard against inline-flex rendering that would prevent long paths from wrapping Fusion-Task-Id: FN-4264
This commit is contained in:
@@ -39,4 +39,24 @@ describe("filePathLinkify", () => {
|
||||
await user.click(screen.getByRole("button", { name: "src/foo.ts:42:7" }));
|
||||
expect(openFile).toHaveBeenCalledWith("src/foo.ts", { line: 42, col: 7 });
|
||||
});
|
||||
|
||||
it("allows long file path links to wrap", () => {
|
||||
const openFile = vi.fn();
|
||||
|
||||
render(
|
||||
<FileBrowserProvider openFile={openFile}>
|
||||
<FilePathLink path="packages/some/very/long/nested/path/file.ts">
|
||||
packages/some/very/long/nested/path/file.ts
|
||||
</FilePathLink>
|
||||
</FileBrowserProvider>,
|
||||
);
|
||||
|
||||
const button = screen.getByRole("button", {
|
||||
name: "packages/some/very/long/nested/path/file.ts",
|
||||
});
|
||||
const styles = getComputedStyle(button);
|
||||
|
||||
expect(styles.whiteSpace).toBe("normal");
|
||||
expect(styles.display).not.toBe("inline-flex");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user