mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-07 07:55:47 +01:00
Humanize workspace diff error state
This commit is contained in:
1 parent
ce6795803e
commit
c91fd1edef
2 files changed
+53
-4
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { createElement } from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ErrorState } from "../src/ui/index.js";
|
||||
|
||||
describe("workspace diff error state", () => {
|
||||
it("keeps bridge error details out of the primary headline", () => {
|
||||
const rawError = "Execution workspace not found";
|
||||
const html = renderToStaticMarkup(createElement(ErrorState, {
|
||||
message: rawError,
|
||||
onRetry: () => undefined,
|
||||
}));
|
||||
|
||||
expect(html).toContain("Unable to load workspace changes.");
|
||||
expect(html).toContain("Retry");
|
||||
expect(html).toContain("Troubleshooting details");
|
||||
expect(html).not.toContain(`font-medium text-foreground">${rawError}`);
|
||||
expect(html.indexOf(rawError)).toBeGreaterThan(html.indexOf("Troubleshooting details"));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user