mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: Redesign workspaces page (#1450)
* feat: Improve navbar to be more compact The navbar was unnecessarily large before, which made the UI feel a bit bloaty from my perspective. * Attempt to remove overrides * Update theme * Add text field * Update theme to dark! * Fix import ordering * Fix page location * Fix requested changes * Add storybook for workspaces page view * Add empty view * Add tests for empty view * Remove templates page * Fix local port * Remove templates from nav * Fix e2e test * Remove time.ts * Remove dep * Add background color to margins * Merge status checking from workspace page * Fix requested changes * Fix workspace status tests
This commit is contained in:
37
site/src/pages/WorkspacesPage/WorkspacesPage.test.tsx
Normal file
37
site/src/pages/WorkspacesPage/WorkspacesPage.test.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { screen } from "@testing-library/react"
|
||||
import { rest } from "msw"
|
||||
import React from "react"
|
||||
import { MockWorkspace } from "../../testHelpers/entities"
|
||||
import { history, render } from "../../testHelpers/renderHelpers"
|
||||
import { server } from "../../testHelpers/server"
|
||||
import WorkspacesPage from "./WorkspacesPage"
|
||||
import { Language } from "./WorkspacesPageView"
|
||||
|
||||
describe("WorkspacesPage", () => {
|
||||
beforeEach(() => {
|
||||
history.replace("/workspaces")
|
||||
})
|
||||
|
||||
it("renders an empty workspaces page", async () => {
|
||||
// Given
|
||||
server.use(
|
||||
rest.get("/api/v2/users/me/workspaces", async (req, res, ctx) => {
|
||||
return res(ctx.status(200), ctx.json([]))
|
||||
}),
|
||||
)
|
||||
|
||||
// When
|
||||
render(<WorkspacesPage />)
|
||||
|
||||
// Then
|
||||
await screen.findByText(Language.emptyView)
|
||||
})
|
||||
|
||||
it("renders a filled workspaces page", async () => {
|
||||
// When
|
||||
render(<WorkspacesPage />)
|
||||
|
||||
// Then
|
||||
await screen.findByText(MockWorkspace.name)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user