import {fireEvent, render, screen} from 'sentry-test/reactTestingLibrary';
import FeatureDisabled from 'sentry/components/acl/featureDisabled';
describe('FeatureDisabled', function () {
it('renders', function () {
render(
);
expect(
screen.getByText('This feature is not enabled on your Sentry installation.')
).toBeInTheDocument();
expect(screen.getByText('Help')).toBeInTheDocument();
});
it('renders with custom message', function () {
const customMessage = 'custom message';
render(
);
expect(screen.getByText(customMessage)).toBeInTheDocument();
});
it('renders with custom alert component', function () {
const customAlert = jest.fn().mockReturnValue(null);
render(
);
expect(customAlert).toHaveBeenCalled();
});
it('displays instructions when help is clicked', function () {
render(
);
fireEvent.click(
screen.getByText('This feature is not enabled on your Sentry installation.')
);
expect(
screen.getByText(/Enable this feature on your sentry installation/)
).toBeInTheDocument();
});
});