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:
Kyle Carberry
2022-05-16 16:52:54 -05:00
committed by GitHub
parent e925818526
commit 22ec366535
53 changed files with 626 additions and 1743 deletions

View 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)
})
})