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

Skip to content
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 workspace tests warnings
  • Loading branch information
BrunoQuaresma committed Mar 1, 2024
commit 642e47598293422dc358ae88a8207b3c49545020
9 changes: 6 additions & 3 deletions site/src/components/FullPageLayout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ interface SidebarIconButton extends ComponentProps<typeof TopbarIconButton> {
isActive: boolean;
}

export const SidebarIconButton: FC<SidebarIconButton> = (props) => {
export const SidebarIconButton: FC<SidebarIconButton> = ({
isActive,
...buttonProps
}) => {
return (
<TopbarIconButton
css={[
{ opacity: 0.75, "&:hover": { opacity: 1 } },
props.isActive && styles.activeSidebarIconButton,
isActive && styles.activeSidebarIconButton,
]}
{...props}
{...buttonProps}
/>
);
};
Expand Down
10 changes: 10 additions & 0 deletions site/src/testHelpers/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ export const handlers = [
rest.put("/api/v2/workspaces/:workspaceId/extend", async (req, res, ctx) => {
return res(ctx.status(200));
}),
rest.get(
"/api/v2/workspaces/:workspaceId/resolve-autostart",
async (req, res, ctx) => {
return res(ctx.status(200), ctx.json({ parameter_mismatch: false }));
},
),

// workspace builds
rest.post("/api/v2/workspaces/:workspaceId/builds", async (req, res, ctx) => {
Expand Down Expand Up @@ -438,4 +444,8 @@ export const handlers = [
rest.get("/api/v2/workspaceagents/:agent/listening-ports", (_, res, ctx) => {
return res(ctx.status(200), ctx.json(M.MockListeningPortsResponse));
}),

rest.get("/api/v2/integrations/jfrog/xray-scan", (_, res, ctx) => {
return res(ctx.status(404));
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we add these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid getting unhandled request warnings during tests. The warning was introduced many PRs ago but I only noticed it now since it was messing with the output for my tests so I just fixed it.

];