Skip to content

Commit 8f5a408

Browse files
committed
fixing merge conflict
2 parents 1b405db + b4c41d3 commit 8f5a408

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri
359359
if err != nil {
360360
return nil, xerrors.Errorf("getting os executable: %w", err)
361361
}
362-
cmd.Env = append(cmd.Env, fmt.Sprintf(`PATH=%s%c%s`, os.Getenv("PATH"), filepath.ListSeparator, executablePath))
362+
cmd.Env = append(cmd.Env, fmt.Sprintf(`PATH=%s%c%s`, os.Getenv("PATH"), filepath.ListSeparator, filepath.Dir(executablePath)))
363363
// Git on Windows resolves with UNIX-style paths.
364364
// If using backslashes, it's unable to find the executable.
365365
unixExecutablePath := strings.ReplaceAll(executablePath, "\\", "/")

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestAgent(t *testing.T) {
8080
ex, err := os.Executable()
8181
t.Log(ex)
8282
require.NoError(t, err)
83-
require.True(t, strings.Contains(strings.TrimSpace(string(output)), ex), string(output), ex)
83+
require.True(t, strings.Contains(strings.TrimSpace(string(output)), filepath.Dir(ex)))
8484
})
8585

8686
t.Run("SessionTTY", func(t *testing.T) {

site/src/components/NavbarView/NavbarView.test.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { screen } from "@testing-library/react"
22
import React from "react"
33
import { MockUser } from "../../testHelpers/entities"
44
import { render } from "../../testHelpers/renderHelpers"
5-
import { NavbarView } from "./NavbarView"
5+
import { Language as navLanguage, NavbarView } from "./NavbarView"
66

77
describe("NavbarView", () => {
88
const noop = () => {
@@ -16,6 +16,24 @@ describe("NavbarView", () => {
1616
await screen.findAllByText("Coder", { exact: false })
1717
})
1818

19+
it("workspaces nav link has the correct href", async () => {
20+
render(<NavbarView user={MockUser} onSignOut={noop} />)
21+
const workspacesLink = await screen.findByText(navLanguage.workspaces)
22+
expect((workspacesLink as HTMLAnchorElement).href).toContain("/workspaces")
23+
})
24+
25+
it("templates nav link has the correct href", async () => {
26+
render(<NavbarView user={MockUser} onSignOut={noop} />)
27+
const templatesLink = await screen.findByText(navLanguage.templates)
28+
expect((templatesLink as HTMLAnchorElement).href).toContain("/templates")
29+
})
30+
31+
it("users nav link has the correct href", async () => {
32+
render(<NavbarView user={MockUser} onSignOut={noop} />)
33+
const userLink = await screen.findByText(navLanguage.users)
34+
expect((userLink as HTMLAnchorElement).href).toContain("/users")
35+
})
36+
1937
it("renders profile picture for user", async () => {
2038
// Given
2139
const mockUser = {

site/src/components/NavbarView/NavbarView.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ export interface NavbarViewProps {
1313
onSignOut: () => void
1414
}
1515

16+
export const Language = {
17+
workspaces: "Workspaces",
18+
templates: "Templates",
19+
users: "Users",
20+
}
21+
1622
export const NavbarView: React.FC<NavbarViewProps> = ({ user, onSignOut }) => {
1723
const styles = useStyles()
1824
return (
@@ -25,12 +31,17 @@ export const NavbarView: React.FC<NavbarViewProps> = ({ user, onSignOut }) => {
2531
</ListItem>
2632
<ListItem button className={styles.item}>
2733
<NavLink className={styles.link} to="/workspaces">
28-
Workspaces
34+
{Language.workspaces}
2935
</NavLink>
3036
</ListItem>
3137
<ListItem button className={styles.item}>
3238
<NavLink className={styles.link} to="/templates">
33-
Templates
39+
{Language.templates}
40+
</NavLink>
41+
</ListItem>
42+
<ListItem button className={styles.item}>
43+
<NavLink className={styles.link} to="/users">
44+
{Language.users}
3445
</NavLink>
3546
</ListItem>
3647
</List>

0 commit comments

Comments
 (0)