Point feature discovery "Learn more" links to their corresponding docs pages (#37204)

* Fix feature discovery Learn more links to point to corresponding docs pages

The auto-translation and Mobile Ephemeral Mode feature discovery upsells
linked their Learn more button to the generic docs.mattermost.com landing
page instead of the corresponding feature documentation. Point them at the
specific docs pages so each feature leads to its own documentation.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Expand auto-translation feature discovery test coverage

Assert the rendered body copy and feature image in addition to the
Learn more docs link, for parity with sibling feature discovery tests.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Add test coverage for Mobile Ephemeral Mode learn more URL

Assert the feature discovery config points at the mobile-security docs
page, mirroring the auto-translation test coverage pattern.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
This commit is contained in:
cursor[bot]
2026-06-26 12:40:24 +02:00
committed by GitHub
co-authored by mattermost-code Cursor Agent
parent 741d1740a2
commit b48f95d22d
4 changed files with 56 additions and 2 deletions
@@ -2750,7 +2750,7 @@ const AdminDefinition: AdminDefinitionType = {
featureName: 'mobile_ephemeral_mode',
title: defineMessage({id: 'admin.mobileSecurity.ephemeralMode_feature_discovery.title', defaultMessage: 'Control mobile data persistence with Mobile Ephemeral Mode'}),
description: defineMessage({id: 'admin.mobileSecurity.ephemeralMode_feature_discovery.description', defaultMessage: 'With Mattermost Enterprise Advanced, you can enable Mobile Ephemeral Mode to enforce data persistence policies on mobile devices. Configure disconnection timeouts, offline data retention, and automatic cache cleanup.'}),
learnMoreURL: 'https://docs.mattermost.com',
learnMoreURL: 'https://docs.mattermost.com/configure/environment-configuration-settings.html#mobile-security',
},
},
isHidden: it.configIsFalse('FeatureFlags', 'MobileEphemeralMode'),
@@ -73,6 +73,9 @@ describe('AdminDefinition - Mobile Ephemeral Mode Settings', () => {
expect(section?.componentProps?.requiredSku).toBe(LicenseSkus.EnterpriseAdvanced);
expect(section?.componentProps?.featureDiscoveryConfig).toBeDefined();
expect(section?.componentProps?.featureDiscoveryConfig?.featureName).toBe('mobile_ephemeral_mode');
expect(section?.componentProps?.featureDiscoveryConfig?.learnMoreURL).toBe(
'https://docs.mattermost.com/configure/environment-configuration-settings.html#mobile-security',
);
});
test('isHidden should return true when feature flag is disabled', () => {
@@ -0,0 +1,51 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {renderWithContext, screen} from 'tests/react_testing_utils';
import AutoTranslationFeatureDiscovery from './auto_translation';
jest.mock('../index', () => {
const React = require('react');
const FeatureDiscovery = require('../feature_discovery').default;
return {
__esModule: true,
default: (props: Record<string, unknown>) => (
<FeatureDiscovery
{...props}
stats={{TOTAL_USERS: 20}}
prevTrialLicense={{IsLicensed: 'true'}}
isCloud={false}
isCloudTrial={false}
hadPrevCloudTrial={false}
isSubscriptionLoaded={true}
isPaidSubscription={false}
isEnterpriseReady={true}
actions={{
getPrevTrialLicense: jest.fn(),
getCloudSubscription: jest.fn(),
openModal: jest.fn(),
}}
/>
),
};
});
describe('components/admin_console/feature_discovery/features/AutoTranslationFeatureDiscovery', () => {
it('renders the Auto-translation discovery card with a Contact sales CTA and a Learn more link to the auto-translation docs', () => {
renderWithContext(<AutoTranslationFeatureDiscovery/>);
expect(screen.getByText('Remove language barriers with auto-translation')).toBeInTheDocument();
expect(screen.getByText(/Effortlessly collaborate across languages/)).toBeInTheDocument();
expect(screen.getByRole('button', {name: 'Contact sales'})).toBeInTheDocument();
expect(screen.getByRole('link', {name: 'Learn more'})).toHaveAttribute(
'href',
expect.stringContaining('docs.mattermost.com/administration-guide/manage/admin/autotranslation.html'),
);
expect(document.querySelector('.FeatureDiscovery_imageWrapper svg')).toBeInTheDocument();
});
});
@@ -35,7 +35,7 @@ const AutoTranslationFeatureDiscovery: React.FC = () => {
defaultMessage: 'Effortlessly collaborate across languages with auto-translation. Messages in shared channels are instantly translated based on each users language preference—no extra steps required.{br}<strong>Only available in Enterprise Advanced.</strong>',
values: {strong: (msg: string) => <strong>{msg}</strong>, br: <br/>},
})}
learnMoreURL='https://docs.mattermost.com'
learnMoreURL='https://docs.mattermost.com/administration-guide/manage/admin/autotranslation.html'
featureDiscoveryImage={
<AutoTranslationSVG
width={158}