Files
coder/site/components/CodeBlock/index.test.tsx
T
Bryan e3089e99d9 refactor: Add <CodeBlock /> component (#168)
This ports over a component from v1 that is needed for the v2 workspace page, and adds theme colors for it:

<img width="772" alt="Screen Shot 2022-02-05 at 10 39 28 AM" src="https://user-images.githubusercontent.com/88213859/152654601-bab5acca-2e4a-4d53-890f-067a3b864040.png">

Component in storybook:
![image](https://user-images.githubusercontent.com/88213859/152654750-35565e5e-1f49-4b29-a140-cda757fb19aa.png)

By bringing in these components ahead of time - it'll make the workspaces page PR smaller.
2022-02-07 09:17:01 -08:00

17 lines
419 B
TypeScript

import { screen } from "@testing-library/react"
import { render } from "../../test_helpers"
import React from "react"
import { CodeBlock } from "./index"
describe("CodeBlock", () => {
it("renders lines)", async () => {
// When
render(<CodeBlock lines={["line1", "line2"]} />)
// Then
// Both lines should be rendered
await screen.findByText("line1")
await screen.findByText("line2")
})
})