mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Update subscription docs link to use single source of truth
This commit is contained in:
parent
725fe99df8
commit
5ff2e7442c
@ -3,6 +3,7 @@ import { withI18n } from '@lingui/react';
|
||||
import { Trans, t } from '@lingui/macro';
|
||||
import { useField } from 'formik';
|
||||
import { Button, Flex, FormGroup } from '@patternfly/react-core';
|
||||
import getDocsBaseUrl from '../../../../util/getDocsBaseUrl';
|
||||
import { required } from '../../../../util/validators';
|
||||
import FormField, {
|
||||
CheckboxField,
|
||||
@ -49,7 +50,9 @@ function AnalyticsStep({ i18n }) {
|
||||
more information, see{' '}
|
||||
<Button
|
||||
component="a"
|
||||
href="http://docs.ansible.com/ansible-tower/latest/html/installandreference/user-data.html#index-0"
|
||||
href={`${getDocsBaseUrl(
|
||||
config
|
||||
)}/html/installandreference/user-data.html#index-0`}
|
||||
variant="link"
|
||||
isInline
|
||||
ouiaId="tower-documentation-link"
|
||||
|
||||
@ -59,6 +59,7 @@ const emptyConfig = {
|
||||
license_info: {
|
||||
valid_key: false,
|
||||
},
|
||||
setConfig: jest.fn(),
|
||||
};
|
||||
|
||||
describe('<SubscriptionEdit />', () => {
|
||||
@ -157,8 +158,9 @@ describe('<SubscriptionEdit />', () => {
|
||||
});
|
||||
|
||||
test('clicking next button should show analytics step', async () => {
|
||||
wrapper.update();
|
||||
await act(async () => {
|
||||
wrapper.find('Button[children="Next"]').simulate('click');
|
||||
wrapper.find('button#subscription-wizard-next').simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('AnalyticsStep').length).toBe(1);
|
||||
@ -185,27 +187,27 @@ describe('<SubscriptionEdit />', () => {
|
||||
|
||||
test('clicking next button should show eula step', async () => {
|
||||
await act(async () => {
|
||||
wrapper.find('Button[children="Next"]').simulate('click');
|
||||
wrapper.find('button#subscription-wizard-next').simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('EulaStep').length).toBe(1);
|
||||
expect(wrapper.find('CheckboxField').length).toBe(1);
|
||||
expect(wrapper.find('Button[children="Submit"]').length).toBe(1);
|
||||
expect(wrapper.find('button#subscription-wizard-submit').length).toBe(1);
|
||||
});
|
||||
|
||||
test('checking EULA agreement should enable Submit button', async () => {
|
||||
expect(wrapper.find('Button[children="Submit"]').prop('isDisabled')).toBe(
|
||||
true
|
||||
);
|
||||
expect(
|
||||
wrapper.find('button#subscription-wizard-submit').prop('disabled')
|
||||
).toBe(true);
|
||||
await act(async () => {
|
||||
wrapper.find('Checkbox[name="eula"] input').simulate('change', {
|
||||
target: { value: true, name: 'eula' },
|
||||
});
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('Button[children="Submit"]').prop('isDisabled')).toBe(
|
||||
false
|
||||
);
|
||||
expect(
|
||||
wrapper.find('button#subscription-wizard-submit').prop('disabled')
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test('should successfully save on form submission', async () => {
|
||||
@ -271,6 +273,7 @@ describe('<SubscriptionEdit />', () => {
|
||||
context: {
|
||||
config: {
|
||||
mockConfig,
|
||||
setConfig: jest.fn(),
|
||||
},
|
||||
me: {
|
||||
is_superuser: true,
|
||||
@ -370,7 +373,7 @@ describe('<SubscriptionEdit />', () => {
|
||||
});
|
||||
test('next should skip analytics step and navigate to eula step', async () => {
|
||||
await act(async () => {
|
||||
wrapper.find('Button[children="Next"]').simulate('click');
|
||||
wrapper.find('button#subscription-wizard-next').simulate('click');
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('SubscriptionStep').length).toBe(0);
|
||||
@ -379,18 +382,18 @@ describe('<SubscriptionEdit />', () => {
|
||||
});
|
||||
|
||||
test('submit should be disabled until EULA agreement checked', async () => {
|
||||
expect(wrapper.find('Button[children="Submit"]').prop('isDisabled')).toBe(
|
||||
true
|
||||
);
|
||||
expect(
|
||||
wrapper.find('button#subscription-wizard-submit').prop('disabled')
|
||||
).toBe(true);
|
||||
await act(async () => {
|
||||
wrapper.find('Checkbox[name="eula"] input').simulate('change', {
|
||||
target: { value: true, name: 'eula' },
|
||||
});
|
||||
});
|
||||
wrapper.update();
|
||||
expect(wrapper.find('Button[children="Submit"]').prop('isDisabled')).toBe(
|
||||
false
|
||||
);
|
||||
expect(
|
||||
wrapper.find('button#subscription-wizard-submit').prop('disabled')
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test('should successfully send request to api on form submission', async () => {
|
||||
@ -420,7 +423,7 @@ describe('<SubscriptionEdit />', () => {
|
||||
el => el.length === 0
|
||||
);
|
||||
await act(async () =>
|
||||
wrapper.find('Button[children="Submit"]').prop('onClick')()
|
||||
wrapper.find('button#subscription-wizard-submit').prop('onClick')()
|
||||
);
|
||||
wrapper.update();
|
||||
waitForElement(wrapper, 'Alert[title="Save successful"]');
|
||||
@ -441,7 +444,7 @@ describe('<SubscriptionEdit />', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.only('should throw a content error', async () => {
|
||||
test('should throw a content error', async () => {
|
||||
RootAPI.readAssetVariables.mockRejectedValueOnce(new Error());
|
||||
let wrapper;
|
||||
await act(async () => {
|
||||
|
||||
@ -16,6 +16,7 @@ import {
|
||||
Tooltip,
|
||||
} from '@patternfly/react-core';
|
||||
import { useConfig } from '../../../../contexts/Config';
|
||||
import getDocsBaseUrl from '../../../../util/getDocsBaseUrl';
|
||||
import useModal from '../../../../util/useModal';
|
||||
import FormField, { PasswordField } from '../../../../components/FormField';
|
||||
import Popover from '../../../../components/Popover';
|
||||
@ -150,7 +151,9 @@ function SubscriptionStep({ i18n }) {
|
||||
. For more information, see the{' '}
|
||||
<Button
|
||||
component="a"
|
||||
href="https://docs.ansible.com/ansible-tower/latest/html/userguide/import_license.html"
|
||||
href={`${getDocsBaseUrl(
|
||||
config
|
||||
)}/html/userguide/import_license.html`}
|
||||
variant="link"
|
||||
target="_blank"
|
||||
ouiaId="import-license-link"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user