Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,6 @@ describe('useAssistantActions', function () {
expect(result.current).to.have.keys(['getIsAssistantEnabled']);
});

it('returns mostly empty object when enableAIAssistant preference is disabled', function () {
const { result } = renderHook(() => useAssistantActions(), {
wrapper: createWrapper(createMockChat({ messages: [] })),
preferences: {
enableAIAssistant: false,
enableGenAIFeatures: true,
enableGenAIFeaturesAtlasOrg: true,
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
},
});

expect(result.current).to.have.keys(['getIsAssistantEnabled']);
});

it('returns actions when both AI features and assistant flag are enabled', function () {
const { result } = renderHook(() => useAssistantActions(), {
wrapper: createWrapper(createMockChat({ messages: [] })),
Expand Down Expand Up @@ -244,21 +230,6 @@ describe('CompassAssistantProvider', function () {
});

describe('disabling the Assistant', function () {
it('does not render assistant drawer when AI assistant is disabled', function () {
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
preferences: {
enableAIAssistant: false,
enableGenAIFeatures: true,
enableGenAIFeaturesAtlasOrg: true,
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
},
});

expect(screen.getByTestId('provider-children')).to.exist;
// The drawer toolbar button should not exist when disabled
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
});

it('does not render assistant drawer when AI features are disabled via isAIFeatureEnabled', function () {
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
preferences: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,6 @@ describe('ExplainPlanModal', function () {
);
});

it('should not show "Interpret for me" button when AI assistant is disabled', function () {
render(
{
status: 'ready',
explainPlan: {
namespace: 'test',
usedIndexes: [],
} as any,
},
{
preferences: {
enableAIAssistant: false,
enableGenAIFeatures: true,
enableGenAIFeaturesAtlasOrg: true,
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
},
}
);
expect(screen.queryByTestId('interpret-for-me-button')).to.not.exist;
});

it('should disable the "Interpret for me" button when the status is not ready', function () {
render(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-preferences-model/src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const featureFlags: Required<{
* Feature flag for AI Assistant.
*/
enableAIAssistant: {
stage: 'development',
stage: 'released',
description: {
short: 'Enable AI Assistant',
},
Expand Down
Loading