Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(site): display template's readme first on template page #6863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
rodrimaia committed Apr 3, 2023
commit 189c3a28deb6a1d490cdcda4a928dbafb84691ed
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { screen } from "@testing-library/react"
import { TemplateLayout } from "components/TemplateLayout/TemplateLayout"
import { ResizeObserver } from "resize-observer"
import { MockTemplate, renderWithAuth } from "testHelpers/renderHelpers"
import { renderWithAuth } from "testHelpers/renderHelpers"
import TemplateDocsPage from "./TemplateDocsPage"

jest.mock("remark-gfm", () => jest.fn())

const TEMPLATE_NAME = "coder-ts"

Object.defineProperty(window, "ResizeObserver", {
value: ResizeObserver,
})
Expand All @@ -16,15 +18,16 @@ const renderPage = () =>
<TemplateDocsPage />
</TemplateLayout>,
{
route: `/templates/${MockTemplate.id}/docs`,
route: `/templates/${TEMPLATE_NAME}/docs`,
path: "/templates/:template/docs",
},
)

const README_FILENAME = "readme.md"

describe("TemplateSummaryPage", () => {
it("shows the template readme", async () => {
renderPage()
await screen.findByText(MockTemplate.display_name)
await screen.findByTestId("markdown")
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("TemplateSummaryPage", () => {

renderPage()
await screen.findByText(MockTemplate.display_name)
screen.getByText(MockWorkspaceResource.name)
screen.queryAllByText(`${MockTemplateVersion.name}`).length
})
it("does not allow a member to delete a template", () => {
Expand Down