Skip to content

Commit

Permalink
chore(settings): update atlas settings text and icon (#4869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemy authored Sep 19, 2023
1 parent 788c84c commit 61eb423
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down Expand Up @@ -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');
});

Expand Down Expand Up @@ -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 }
);
Expand All @@ -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');
});
});
Expand All @@ -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 }
);
Expand All @@ -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');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Icon,
KeylineCard,
Label,
MongoDBLogoMark,
SpinLoader,
Subtitle,
Toggle,
Expand Down Expand Up @@ -106,10 +105,7 @@ export const AtlasLoginSettings: React.FunctionComponent<{
)}
>
<Subtitle className={atlasLoginHeadingTitleStyles}>
<MongoDBLogoMark
color={darkMode ? 'white' : 'black'}
height={18}
></MongoDBLogoMark>
<Icon glyph="Sparkle" />
<span>Use Generative AI</span>
<Badge variant="blue">Preview</Badge>
</Subtitle>
Expand Down Expand Up @@ -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.
</Label>
</div>
{isSignedIn && !isAIFeatureEnabled && (
Expand Down

0 comments on commit 61eb423

Please sign in to comment.