diff --git a/site/src/modules/resources/AppLink/AppLink.test.tsx b/site/src/modules/resources/AppLink/AppLink.test.tsx
new file mode 100644
index 0000000000..44676b22c2
--- /dev/null
+++ b/site/src/modules/resources/AppLink/AppLink.test.tsx
@@ -0,0 +1,25 @@
+import {
+ MockWorkspace,
+ MockWorkspaceAgent,
+ MockWorkspaceApp,
+} from "testHelpers/entities";
+import { renderWithAuth } from "testHelpers/renderHelpers";
+import { screen } from "@testing-library/react";
+import { AppLink } from "./AppLink";
+
+const renderAppLink = (app: typeof MockWorkspaceApp) => {
+ return renderWithAuth(
+ ,
+ );
+};
+
+// Regression test for https://github.com/coder/coder/issues/18573:
+// open_in="tab" was not opening links in a new tab.
+describe("AppLink", () => {
+ it("sets target=_blank and rel=noreferrer when open_in is tab", async () => {
+ renderAppLink({ ...MockWorkspaceApp, open_in: "tab" });
+ const link = await screen.findByRole("link");
+ expect(link).toHaveAttribute("target", "_blank");
+ expect(link).toHaveAttribute("rel", "noreferrer");
+ });
+});
diff --git a/site/src/modules/resources/AppLink/AppLink.tsx b/site/src/modules/resources/AppLink/AppLink.tsx
index 1c26704027..1b023522a3 100644
--- a/site/src/modules/resources/AppLink/AppLink.tsx
+++ b/site/src/modules/resources/AppLink/AppLink.tsx
@@ -135,7 +135,12 @@ export const AppLink: FC = ({
const button = grouped ? (
-
+
{icon}
{link.label}
{ShareIcon && }
@@ -143,7 +148,12 @@ export const AppLink: FC = ({
) : (
-
+
{icon}
{link.label}
{ShareIcon && }