mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is Functional Software's trademark, so every place the running app says it to a user -- page titles, onboarding, empty states, toasts, settings copy, the self-hosted footer -- now says Sentinel. Attribution is the other half of the deal and stays untouched: upstream copyright headers, LICENSE, NOTICE. So does anything where the mark is a fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree. Renaming those would leave instructions that no longer work. Nothing structural moved. No import, identifier, route path, feature flag, API field or test id changed; the diff is 312 lines in and 312 out. Colocated specs were updated in lockstep with the copy they assert. Marketing and community links point at hanzo.ai, only where a real page exists to point at. Co-authored-by: Hanzo Dev <[email protected]>
72 lines
2.0 KiB
TypeScript
72 lines
2.0 KiB
TypeScript
import {fireEvent, render, screen} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import FeatureDisabled from 'sentry/components/acl/featureDisabled';
|
|
|
|
describe('FeatureDisabled', function () {
|
|
it('renders', function () {
|
|
render(
|
|
<FeatureDisabled features="organization:my-features" featureName="Some Feature" />
|
|
);
|
|
|
|
expect(
|
|
screen.getByText('This feature is not enabled on your Sentinel installation.')
|
|
).toBeInTheDocument();
|
|
expect(screen.getByText('Help')).toBeInTheDocument();
|
|
});
|
|
|
|
it('supports a list of disabled features', function () {
|
|
render(
|
|
<FeatureDisabled
|
|
features={['organization:my-features', 'organization:other-feature']}
|
|
featureName="Some Feature"
|
|
/>
|
|
);
|
|
|
|
expect(
|
|
screen.getByText('This feature is not enabled on your Sentinel installation.')
|
|
).toBeInTheDocument();
|
|
expect(screen.getByText('Help')).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders with custom message', function () {
|
|
const customMessage = 'custom message';
|
|
render(
|
|
<FeatureDisabled
|
|
message={customMessage}
|
|
features="organization:my-features"
|
|
featureName="Some Feature"
|
|
/>
|
|
);
|
|
|
|
expect(screen.getByText(customMessage)).toBeInTheDocument();
|
|
});
|
|
|
|
it('renders with custom alert component', function () {
|
|
const customAlert = jest.fn().mockReturnValue(null);
|
|
render(
|
|
<FeatureDisabled
|
|
alert={customAlert}
|
|
features="organization:my-features"
|
|
featureName="Some Feature"
|
|
/>
|
|
);
|
|
expect(customAlert).toHaveBeenCalled();
|
|
});
|
|
|
|
it('displays instructions when help is clicked', function () {
|
|
render(
|
|
<FeatureDisabled
|
|
alert
|
|
features="organization:my-features"
|
|
featureName="Some Feature"
|
|
/>
|
|
);
|
|
fireEvent.click(
|
|
screen.getByText('This feature is not enabled on your Sentinel installation.')
|
|
);
|
|
expect(
|
|
screen.getByText(/Enable this feature on your sentry installation/)
|
|
).toBeInTheDocument();
|
|
});
|
|
});
|