diff --git a/docker/env/web.example.env b/docker/env/web.example.env index b7ae2c98..877afb94 100644 --- a/docker/env/web.example.env +++ b/docker/env/web.example.env @@ -17,7 +17,6 @@ NUXT_PUBLIC_SENTRY_DSN= NUXT_PUBLIC_LINK_TO_MORE_INFO_ABOUT_PRODUCT=https://oxynote.io NUXT_PUBLIC_TERMS_OF_SERVICE_URL= NUXT_PUBLIC_PRIVACY_POLICY_URL= -NUXT_PUBLIC_EXPERIMENTAL_FEATURES= # in-app documentation links NUXT_PUBLIC_POSTGRESQL_READ_ONLY_USER_SETUP_GUIDE_URL=https://tableplus.com/blog/2018/04/postgresql-how-to-create-read-only-user.html diff --git a/web/app/components/AppSidebar.nuxt.test.ts b/web/app/components/AppSidebar.nuxt.test.ts index b30b8010..30b3336a 100644 --- a/web/app/components/AppSidebar.nuxt.test.ts +++ b/web/app/components/AppSidebar.nuxt.test.ts @@ -13,6 +13,7 @@ import { mockAuthEndpoint, mountUnderSidebarProvider, seedAuthOrganization, + seedCapabilities, settleMutations, stubViewportMatches, t, @@ -356,7 +357,8 @@ describe("", { concurrent: false }, () => { it("hides the github integration on a deployment without it", async ({ expect, }) => { - stubQueries({ gitHub: { connected: false, configured: false } }) + stubQueries({}) + seedCapabilities({ github: false }) const wrapper = await mountSidebar() await settleMutations() @@ -382,7 +384,8 @@ describe("", { concurrent: false }, () => { it("hides the slack integration on a deployment without it", async ({ expect, }) => { - stubQueries({ slack: { connected: false, configured: false } }) + stubQueries({}) + seedCapabilities({ slack: false }) const wrapper = await mountSidebar() await settleMutations() diff --git a/web/app/components/DocumentHeader.nuxt.test.ts b/web/app/components/DocumentHeader.nuxt.test.ts index b7b280f4..f6f84009 100644 --- a/web/app/components/DocumentHeader.nuxt.test.ts +++ b/web/app/components/DocumentHeader.nuxt.test.ts @@ -12,7 +12,7 @@ import { findButtonByText, menuItem, mountUnderSidebarProvider, - seedAuthOrganization, + seedCapabilities, settleMutations, t, } from "./test-helpers" @@ -367,15 +367,28 @@ describe("", { concurrent: false }, () => { expect(created).toHaveLength(0) }) - it("hides the assistant button while the feature is off", async ({ + it("hides the assistant button on a deployment without the assistant", async ({ expect, }) => { mainOnly() - seedAuthOrganization({ id: "org-without-the-feature" }) + seedCapabilities({ aiAssistant: { status: AssistantStatus.Inactive } }) const wrapper = await mountHeader() - expect(wrapper.text()).not.toContain(t("editor.ai-chat.title")) + expect(wrapper.text()).not.toContain(t("editor.navbar.open-ai-assistant")) + }) + + it("offers the assistant button when the assistant runs", async ({ + expect, + }) => { + mainOnly() + seedCapabilities({ + aiAssistant: { status: AssistantStatus.ActiveButWeak, model: "small" }, + }) + + const wrapper = await mountHeader() + + expect(wrapper.text()).toContain(t("editor.navbar.open-ai-assistant")) }) it("publishes the header height so the page can offset content", async ({ diff --git a/web/app/components/DocumentHeader.vue b/web/app/components/DocumentHeader.vue index 1037a792..4cb81e43 100644 --- a/web/app/components/DocumentHeader.vue +++ b/web/app/components/DocumentHeader.vue @@ -1,7 +1,6 @@