Spaces:
Configuration error
Configuration error
Download web/libs/ui/src/lib/code-editor/code-editor.spec.tsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 804 Bytes
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/ui/src/lib/code-editor/code-editor.spec.tsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/ui/src/lib/code-editor/code-editor.spec.tsx
-
curl -L -o code-editor.spec.tsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/ui/src/lib/code-editor/code-editor.spec.tsx
804 Bytes
| import { render } from "@testing-library/react"; | |
| import CodeEditor from "./code-editor"; | |
| // CodeMirror uses Range.prototype.getBoundingClientRect, which jsdom does not provide. | |
| beforeAll(() => { | |
| if (typeof Range !== "undefined" && !Range.prototype.getBoundingClientRect) { | |
| Range.prototype.getBoundingClientRect = function () { | |
| const rect = this.getClientRects?.(); | |
| if (rect?.[0]) return rect[0]; | |
| return { | |
| x: 0, | |
| y: 0, | |
| width: 0, | |
| height: 0, | |
| top: 0, | |
| right: 0, | |
| bottom: 0, | |
| left: 0, | |
| toJSON: () => ({}), | |
| } as DOMRect; | |
| }; | |
| } | |
| }); | |
| describe("CodeEditor", () => { | |
| it("should render successfully", () => { | |
| const { baseElement } = render(<CodeEditor />); | |
| expect(baseElement).toBeTruthy(); | |
| }); | |
| }); | |