From 61eb423ebf1a8515f2951748e91bf5bca24de9b9 Mon Sep 17 00:00:00 2001 From: Rhys Date: Tue, 19 Sep 2023 12:53:29 -0400 Subject: [PATCH] chore(settings): update atlas settings text and icon (#4869) --- .../components/settings/atlas-login.spec.tsx | 36 ++++++++++++++----- .../src/components/settings/atlas-login.tsx | 10 ++---- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/packages/compass-settings/src/components/settings/atlas-login.spec.tsx b/packages/compass-settings/src/components/settings/atlas-login.spec.tsx index ce6b44ddf0b..4843eb18f32 100644 --- a/packages/compass-settings/src/components/settings/atlas-login.spec.tsx +++ b/packages/compass-settings/src/components/settings/atlas-login.spec.tsx @@ -61,7 +61,9 @@ describe('AtlasLoginSettings', function () { .exist; expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'false'); }); @@ -92,11 +94,15 @@ describe('AtlasLoginSettings', function () { ).to.exist; expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'false'); expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('disabled'); }); @@ -229,11 +235,15 @@ describe('AtlasLoginSettings', function () { await store.dispatch(signIn()); expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'false'); userEvent.click( - screen.getByRole('switch', { name: /Use AI to generate queries/ }), + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }), undefined, { skipPointerEventsCheck: true } ); @@ -242,7 +252,9 @@ describe('AtlasLoginSettings', function () { await waitFor(() => { expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'true'); }); }); @@ -261,11 +273,15 @@ describe('AtlasLoginSettings', function () { await store.dispatch(signIn()); expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'true'); userEvent.click( - screen.getByRole('switch', { name: /Use AI to generate queries/ }), + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }), undefined, { skipPointerEventsCheck: true } ); @@ -274,7 +290,9 @@ describe('AtlasLoginSettings', function () { await waitFor(() => { expect( - screen.getByRole('switch', { name: /Use AI to generate queries/ }) + screen.getByRole('switch', { + name: /Enable natural language prompts to generate/, + }) ).to.have.attribute('aria-checked', 'false'); }); }); diff --git a/packages/compass-settings/src/components/settings/atlas-login.tsx b/packages/compass-settings/src/components/settings/atlas-login.tsx index 187d2c7d64c..ce1523b4473 100644 --- a/packages/compass-settings/src/components/settings/atlas-login.tsx +++ b/packages/compass-settings/src/components/settings/atlas-login.tsx @@ -6,7 +6,6 @@ import { Icon, KeylineCard, Label, - MongoDBLogoMark, SpinLoader, Subtitle, Toggle, @@ -106,10 +105,7 @@ export const AtlasLoginSettings: React.FunctionComponent<{ )} > - + Use Generative AI Preview @@ -166,8 +162,8 @@ export const AtlasLoginSettings: React.FunctionComponent<{ htmlFor="use-ai-toggle" className={atlasLoginToggleControlLabelStyles} > - Use AI to generate queries and aggregations with a natural language - text input on the query bar and aggregation page. + Enable natural language prompts to generate queries and + aggregations. {isSignedIn && !isAIFeatureEnabled && (