File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { render } from "@/lib/test-utils" ;
2
- import { screen , waitFor } from "@testing-library/react" ;
2
+ import { screen , waitFor , within } from "@testing-library/react" ;
3
3
import { describe , expect , it } from "vitest" ;
4
4
import { Workspaces } from "./Workspaces" ;
5
5
@@ -32,5 +32,13 @@ describe("Workspaces page", () => {
32
32
expect (
33
33
screen . getByRole ( "rowheader" , { name : / a n o t h e r w o r k s p a e / i } ) ,
34
34
) . toBeVisible ( ) ;
35
+
36
+ const firstRow = screen . getByRole ( "row" , { name : / m y w o r k s p a c e / i } ) ;
37
+ const firstButton = within ( firstRow ) . getByRole ( "link" , {
38
+ name : / s e t t i n g s / i,
39
+ } ) ;
40
+
41
+ expect ( firstButton ) . toBeVisible ( ) ;
42
+ expect ( firstButton ) . toHaveAttribute ( "href" , "/workspace/myworkspace" ) ;
35
43
} ) ;
36
44
} ) ;
Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import { useWorkspacesData } from "@/hooks/useWorkspacesData";
2
2
import {
3
3
Cell ,
4
4
Column ,
5
+ LinkButton ,
5
6
Row ,
6
7
Table ,
7
8
TableBody ,
8
9
TableHeader ,
9
10
} from "@stacklok/ui-kit" ;
11
+ import { Settings } from "lucide-react" ;
10
12
11
13
export function Workspaces ( ) {
12
14
const result = useWorkspacesData ( ) ;
@@ -28,7 +30,15 @@ export function Workspaces() {
28
30
{ workspaces . map ( ( workspace ) => (
29
31
< Row key = { workspace . name } >
30
32
< Cell > { workspace . name } </ Cell >
31
- < Cell > hello</ Cell >
33
+ < Cell >
34
+ < LinkButton
35
+ href = { `/workspace/${ workspace . name } ` }
36
+ variant = "tertiary"
37
+ >
38
+ < Settings />
39
+ Settings
40
+ </ LinkButton >
41
+ </ Cell >
32
42
</ Row >
33
43
) ) }
34
44
</ TableBody >
You can’t perform that action at this time.
0 commit comments