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 @@ -207,10 +207,14 @@ const openConnectionFailedToast = ({
}
: undefined
}
onDebug={() => {
closeToast(`connection-status--${failedToastId}`);
onDebugClick?.();
}}
onDebug={
onDebugClick
? () => {
closeToast(`connection-status--${failedToastId}`);
onDebugClick();
}
: undefined
}
/>
),
variant: 'warning',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ describe('CompassConnections store', function () {
});
});

it('should not show debug action when assistant is disabled', async function () {
const { connectionsStore } = renderCompassConnections({
preferences: {
enableAIAssistant: false,
enableGenAIFeatures: false,
enableGenAIFeaturesAtlasOrg: false,
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: false },
},
connectFn: sinon
.stub()
.rejects(new Error('Failed to connect to cluster')),
});

const connectionInfo = createDefaultConnectionInfo();

void connectionsStore.actions.connect(connectionInfo);

await waitFor(() => {
expect(screen.getByText('Failed to connect to cluster')).to.exist;
});

// The debug button should not be present when assistant is disabled
expect(screen.queryByText('Debug for me')).to.not.exist;
expect(screen.queryByTestId('connection-error-debug')).to.not.exist;
});

it('should show non-genuine modal at the end of connection if non genuine mongodb detected', async function () {
const { connectionsStore } = renderCompassConnections({});

Expand Down
Loading