Commit b06baf47 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'find-migrate-ee-security-configuration' into 'master'

Replace deprecated usage of find/findAll in ee/spec/frontend/security_configuration

See merge request gitlab-org/gitlab!78634
parents 44a0e246 d35d8af3
...@@ -21,8 +21,8 @@ describe('EE - ApiFuzzingConfigurationApp', () => { ...@@ -21,8 +21,8 @@ describe('EE - ApiFuzzingConfigurationApp', () => {
const createMockApolloProvider = (handler) => const createMockApolloProvider = (handler) =>
createMockApollo([[apiFuzzingCiConfigurationQuery, handler]]); createMockApollo([[apiFuzzingCiConfigurationQuery, handler]]);
const findLoadingSpinner = () => wrapper.find(GlLoadingIcon); const findLoadingSpinner = () => wrapper.findComponent(GlLoadingIcon);
const findConfigurationForm = () => wrapper.find(ConfigurationForm); const findConfigurationForm = () => wrapper.findComponent(ConfigurationForm);
const createWrapper = (options) => { const createWrapper = (options) => {
wrapper = shallowMount( wrapper = shallowMount(
...@@ -80,7 +80,7 @@ describe('EE - ApiFuzzingConfigurationApp', () => { ...@@ -80,7 +80,7 @@ describe('EE - ApiFuzzingConfigurationApp', () => {
}); });
it('includes a link to API fuzzing documentation ', () => { it('includes a link to API fuzzing documentation ', () => {
const link = wrapper.find(GlLink); const link = wrapper.findComponent(GlLink);
expect(link.exists()).toBe(true); expect(link.exists()).toBe(true);
expect(link.attributes('href')).toBe('/api_fuzzing/documentation/path'); expect(link.attributes('href')).toBe('/api_fuzzing/documentation/path');
}); });
......
...@@ -25,17 +25,17 @@ describe('EE - ApiFuzzingConfigurationForm', () => { ...@@ -25,17 +25,17 @@ describe('EE - ApiFuzzingConfigurationForm', () => {
const findEnableAuthenticationCheckbox = () => const findEnableAuthenticationCheckbox = () =>
wrapper.findByTestId('api-fuzzing-enable-authentication-checkbox'); wrapper.findByTestId('api-fuzzing-enable-authentication-checkbox');
const findTargetUrlInput = () => wrapper.findAll(FormInput).at(0); const findTargetUrlInput = () => wrapper.findAllComponents(FormInput).at(0);
const findScanModeInput = () => wrapper.findAll(DropdownInput).at(0); const findScanModeInput = () => wrapper.findAllComponents(DropdownInput).at(0);
const findSpecificationFileInput = () => wrapper.findAll(FormInput).at(1); const findSpecificationFileInput = () => wrapper.findAllComponents(FormInput).at(1);
const findAuthenticationNotice = () => wrapper.findByTestId('api-fuzzing-authentication-notice'); const findAuthenticationNotice = () => wrapper.findByTestId('api-fuzzing-authentication-notice');
const findAuthenticationFields = () => wrapper.find(DynamicFields); const findAuthenticationFields = () => wrapper.findComponent(DynamicFields);
const findScanProfileDropdownInput = () => wrapper.findAll(DropdownInput).at(1); const findScanProfileDropdownInput = () => wrapper.findAllComponents(DropdownInput).at(1);
const findScanProfileYamlViewer = () => const findScanProfileYamlViewer = () =>
wrapper.findByTestId('api-fuzzing-scan-profile-yaml-viewer'); wrapper.findByTestId('api-fuzzing-scan-profile-yaml-viewer');
const findSubmitButton = () => wrapper.findByTestId('api-fuzzing-configuration-submit-button'); const findSubmitButton = () => wrapper.findByTestId('api-fuzzing-configuration-submit-button');
const findCancelButton = () => wrapper.findByTestId('api-fuzzing-configuration-cancel-button'); const findCancelButton = () => wrapper.findByTestId('api-fuzzing-configuration-cancel-button');
const findConfigurationSnippetModal = () => wrapper.find(ConfigurationSnippetModal); const findConfigurationSnippetModal = () => wrapper.findComponent(ConfigurationSnippetModal);
const setFormData = async () => { const setFormData = async () => {
findTargetUrlInput().vm.$emit('input', 'https://gitlab.com'); findTargetUrlInput().vm.$emit('input', 'https://gitlab.com');
...@@ -104,7 +104,7 @@ describe('EE - ApiFuzzingConfigurationForm', () => { ...@@ -104,7 +104,7 @@ describe('EE - ApiFuzzingConfigurationForm', () => {
}); });
it('by default, the specification file input is hidden', () => { it('by default, the specification file input is hidden', () => {
expect(wrapper.findAll(FormInput)).toHaveLength(1); expect(wrapper.findAllComponents(FormInput)).toHaveLength(1);
}); });
describe.each(Object.keys(SCAN_MODES))('when %s scan mode is selected', (scanMode) => { describe.each(Object.keys(SCAN_MODES))('when %s scan mode is selected', (scanMode) => {
......
...@@ -30,7 +30,7 @@ const redirectParam = 'foo'; ...@@ -30,7 +30,7 @@ const redirectParam = 'foo';
describe('EE - SecurityConfigurationSnippetModal', () => { describe('EE - SecurityConfigurationSnippetModal', () => {
let wrapper; let wrapper;
const findModal = () => wrapper.find(GlModal); const findModal = () => wrapper.findComponent(GlModal);
const helpText = () => wrapper.findByTestId('configuration-modal-help-text'); const helpText = () => wrapper.findByTestId('configuration-modal-help-text');
const findEditor = () => wrapper.findComponent(SourceEditor); const findEditor = () => wrapper.findComponent(SourceEditor);
......
...@@ -39,8 +39,8 @@ describe('DropdownInput component', () => { ...@@ -39,8 +39,8 @@ describe('DropdownInput component', () => {
const findToggle = () => wrapper.find('button'); const findToggle = () => wrapper.find('button');
const findLabel = () => wrapper.find('label'); const findLabel = () => wrapper.find('label');
const findDescription = () => wrapper.findByTestId('dropdown-input-description'); const findDescription = () => wrapper.findByTestId('dropdown-input-description');
const findInputComponent = () => wrapper.find(GlDropdown); const findInputComponent = () => wrapper.findComponent(GlDropdown);
const findRestoreDefaultLink = () => wrapper.find(GlLink); const findRestoreDefaultLink = () => wrapper.findComponent(GlLink);
const findSectionHeader = () => wrapper.findByTestId('dropdown-input-section-header'); const findSectionHeader = () => wrapper.findByTestId('dropdown-input-section-header');
afterEach(() => { afterEach(() => {
......
...@@ -13,7 +13,7 @@ describe('DynamicFields component', () => { ...@@ -13,7 +13,7 @@ describe('DynamicFields component', () => {
}); });
}; };
const findFields = () => wrapper.findAll({ ref: 'fields' }); const findFields = () => wrapper.findAllComponents({ ref: 'fields' });
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
......
...@@ -25,8 +25,8 @@ describe('FormInput component', () => { ...@@ -25,8 +25,8 @@ describe('FormInput component', () => {
const findInput = () => wrapper.find('input[type="text"]'); const findInput = () => wrapper.find('input[type="text"]');
const findLabel = () => wrapper.find('label'); const findLabel = () => wrapper.find('label');
const findInputComponent = () => wrapper.find(GlFormInput); const findInputComponent = () => wrapper.findComponent(GlFormInput);
const findRestoreDefaultLink = () => wrapper.find(GlLink); const findRestoreDefaultLink = () => wrapper.findComponent(GlLink);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
......
...@@ -26,7 +26,7 @@ describe('Action buttons', () => { ...@@ -26,7 +26,7 @@ describe('Action buttons', () => {
describe('corpus management', () => { describe('corpus management', () => {
it('renders the action buttons', () => { it('renders the action buttons', () => {
createComponent(); createComponent();
expect(wrapper.findAll(GlButton)).toHaveLength(2); expect(wrapper.findAllComponents(GlButton)).toHaveLength(2);
}); });
describe('delete confirmation modal', () => { describe('delete confirmation modal', () => {
......
...@@ -10,7 +10,7 @@ describe('Corpus upload modal', () => { ...@@ -10,7 +10,7 @@ describe('Corpus upload modal', () => {
const findUploadAttachment = () => wrapper.find('[data-testid="upload-attachment-button"]'); const findUploadAttachment = () => wrapper.find('[data-testid="upload-attachment-button"]');
const findUploadCorpus = () => wrapper.find('[data-testid="upload-corpus"]'); const findUploadCorpus = () => wrapper.find('[data-testid="upload-corpus"]');
const findUploadStatus = () => wrapper.find('[data-testid="upload-status"]'); const findUploadStatus = () => wrapper.find('[data-testid="upload-status"]');
const findFileInput = () => wrapper.find({ ref: 'fileUpload' }); const findFileInput = () => wrapper.findComponent({ ref: 'fileUpload' });
const findCancelButton = () => wrapper.find('[data-testid="cancel-upload"]'); const findCancelButton = () => wrapper.find('[data-testid="cancel-upload"]');
const createComponent = (propsData, options = {}) => { const createComponent = (propsData, options = {}) => {
......
...@@ -59,7 +59,7 @@ describe('EE - DastProfilesList', () => { ...@@ -59,7 +59,7 @@ describe('EE - DastProfilesList', () => {
const getErrorDetails = () => withinComponent().queryByRole('list', { name: /error details/i }); const getErrorDetails = () => withinComponent().queryByRole('list', { name: /error details/i });
const getDeleteButtonWithin = (element) => const getDeleteButtonWithin = (element) =>
createWrapper(within(element).queryByTestId('dast-profile-delete-button')); createWrapper(within(element).queryByTestId('dast-profile-delete-button'));
const getModal = () => wrapper.find(GlModal); const getModal = () => wrapper.findComponent(GlModal);
const getDeleteTooltip = () => wrapper.find('[data-testid="dast-profile-delete-tooltip"'); const getDeleteTooltip = () => wrapper.find('[data-testid="dast-profile-delete-tooltip"');
afterEach(() => { afterEach(() => {
......
...@@ -63,10 +63,10 @@ describe('EE - DastProfiles', () => { ...@@ -63,10 +63,10 @@ describe('EE - DastProfiles', () => {
const withinComponent = () => within(wrapper.element); const withinComponent = () => within(wrapper.element);
const getProfilesComponent = (profileType) => wrapper.find(`[data-testid="${profileType}List"]`); const getProfilesComponent = (profileType) => wrapper.find(`[data-testid="${profileType}List"]`);
const getDropdownComponent = () => wrapper.find(GlDropdown); const getDropdownComponent = () => wrapper.findComponent(GlDropdown);
const getSiteProfilesDropdownItem = (text) => const getSiteProfilesDropdownItem = (text) =>
within(getDropdownComponent().element).queryByText(text); within(getDropdownComponent().element).queryByText(text);
const getTabsComponent = () => wrapper.find(GlTabs); const getTabsComponent = () => wrapper.findComponent(GlTabs);
const getTab = ({ tabName, selected }) => const getTab = ({ tabName, selected }) =>
withinComponent().getByRole('tab', { withinComponent().getByRole('tab', {
name: tabName, name: tabName,
......
...@@ -26,7 +26,7 @@ describe('EE - DastSavedScansList', () => { ...@@ -26,7 +26,7 @@ describe('EE - DastSavedScansList', () => {
createWrapper({ branch, editPath }); createWrapper({ branch, editPath });
expect(wrapper.text()).toContain(branch.name); expect(wrapper.text()).toContain(branch.name);
expect(wrapper.find(GlIcon).props('name')).toBe('branch'); expect(wrapper.findComponent(GlIcon).props('name')).toBe('branch');
}); });
describe('branch does not exist', () => { describe('branch does not exist', () => {
...@@ -37,11 +37,11 @@ describe('EE - DastSavedScansList', () => { ...@@ -37,11 +37,11 @@ describe('EE - DastSavedScansList', () => {
it('renders a warning message', () => { it('renders a warning message', () => {
expect(wrapper.text()).toContain('Branch missing'); expect(wrapper.text()).toContain('Branch missing');
expect(wrapper.find(GlIcon).props('name')).toBe('warning'); expect(wrapper.findComponent(GlIcon).props('name')).toBe('warning');
}); });
it('renders the edit link', () => { it('renders the edit link', () => {
const link = wrapper.find(GlLink); const link = wrapper.findComponent(GlLink);
expect(link.text()).toBe('Select branch'); expect(link.text()).toBe('Select branch');
expect(link.attributes('href')).toBe(scanWithInexistingBranch.editPath); expect(link.attributes('href')).toBe(scanWithInexistingBranch.editPath);
}); });
......
...@@ -6,7 +6,7 @@ import { SCAN_TYPE } from 'ee/security_configuration/dast_profiles/dast_scanner_ ...@@ -6,7 +6,7 @@ import { SCAN_TYPE } from 'ee/security_configuration/dast_profiles/dast_scanner_
describe('EE - DastScanTypeBadge', () => { describe('EE - DastScanTypeBadge', () => {
let wrapper; let wrapper;
const findBadge = () => wrapper.find(GlBadge); const findBadge = () => wrapper.findComponent(GlBadge);
const wrapperFactory = (mountFn = shallowMount) => (options = {}) => { const wrapperFactory = (mountFn = shallowMount) => (options = {}) => {
wrapper = mountFn(DastScanTypeBadge, options); wrapper = mountFn(DastScanTypeBadge, options);
......
...@@ -39,7 +39,7 @@ describe('DastScannerProfileForm', () => { ...@@ -39,7 +39,7 @@ describe('DastScannerProfileForm', () => {
const findBaseDastProfileForm = () => wrapper.findComponent(BaseDastProfileForm); const findBaseDastProfileForm = () => wrapper.findComponent(BaseDastProfileForm);
const findParentFormGroup = () => wrapper.findByTestId('dast-scanner-parent-group'); const findParentFormGroup = () => wrapper.findByTestId('dast-scanner-parent-group');
const findForm = () => wrapper.find(GlForm); const findForm = () => wrapper.findComponent(GlForm);
const findProfileNameInput = () => wrapper.findByTestId('profile-name-input'); const findProfileNameInput = () => wrapper.findByTestId('profile-name-input');
const findSpiderTimeoutInput = () => wrapper.findByTestId('spider-timeout-input'); const findSpiderTimeoutInput = () => wrapper.findByTestId('spider-timeout-input');
const findTargetTimeoutInput = () => wrapper.findByTestId('target-timeout-input'); const findTargetTimeoutInput = () => wrapper.findByTestId('target-timeout-input');
......
...@@ -6,7 +6,7 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; ...@@ -6,7 +6,7 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
describe('Tooltip Icon', () => { describe('Tooltip Icon', () => {
let wrapper; let wrapper;
const findIcon = () => wrapper.find(GlIcon); const findIcon = () => wrapper.findComponent(GlIcon);
const title = 'Hello world'; const title = 'Hello world';
const createComponent = (props = {}, mountFn = shallowMount) => { const createComponent = (props = {}, mountFn = shallowMount) => {
......
...@@ -28,7 +28,7 @@ describe('DastSiteAuthSection', () => { ...@@ -28,7 +28,7 @@ describe('DastSiteAuthSection', () => {
const findParentFormGroup = () => wrapper.findByTestId('dast-site-auth-parent-group'); const findParentFormGroup = () => wrapper.findByTestId('dast-site-auth-parent-group');
const findByNameAttribute = (name) => wrapper.find(`[name="${name}"]`); const findByNameAttribute = (name) => wrapper.find(`[name="${name}"]`);
const findAuthForm = () => wrapper.findByTestId('auth-form'); const findAuthForm = () => wrapper.findByTestId('auth-form');
const findAuthCheckbox = () => wrapper.find(GlFormCheckbox); const findAuthCheckbox = () => wrapper.findComponent(GlFormCheckbox);
const setAuthentication = ({ enabled }) => { const setAuthentication = ({ enabled }) => {
findAuthCheckbox().vm.$emit('input', enabled); findAuthCheckbox().vm.$emit('input', enabled);
......
...@@ -72,7 +72,7 @@ describe('DastSiteValidationModal', () => { ...@@ -72,7 +72,7 @@ describe('DastSiteValidationModal', () => {
const createComponent = componentFactory(); const createComponent = componentFactory();
const createFullComponent = componentFactory(mount); const createFullComponent = componentFactory(mount);
const withinComponent = () => within(wrapper.find(GlModal).element); const withinComponent = () => within(wrapper.findComponent(GlModal).element);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"`); const findByTestId = (id) => wrapper.find(`[data-testid="${id}"`);
const findDownloadButton = () => findByTestId('download-dast-text-file-validation-button'); const findDownloadButton = () => findByTestId('download-dast-text-file-validation-button');
const findValidationPathPrefix = () => findByTestId('dast-site-validation-path-prefix'); const findValidationPathPrefix = () => findByTestId('dast-site-validation-path-prefix');
...@@ -119,9 +119,9 @@ describe('DastSiteValidationModal', () => { ...@@ -119,9 +119,9 @@ describe('DastSiteValidationModal', () => {
}); });
it('renders a skeleton loader, no alert and no form group while token is being created', () => { it('renders a skeleton loader, no alert and no form group while token is being created', () => {
expect(wrapper.find(GlSkeletonLoader).exists()).toBe(true); expect(wrapper.findComponent(GlSkeletonLoader).exists()).toBe(true);
expect(wrapper.find(GlAlert).exists()).toBe(false); expect(wrapper.findComponent(GlAlert).exists()).toBe(false);
expect(wrapper.find(GlFormGroup).exists()).toBe(false); expect(wrapper.findComponent(GlFormGroup).exists()).toBe(false);
}); });
}); });
...@@ -136,9 +136,9 @@ describe('DastSiteValidationModal', () => { ...@@ -136,9 +136,9 @@ describe('DastSiteValidationModal', () => {
}); });
it('renders an alert and no skeleton loader or form group if token could not be created', () => { it('renders an alert and no skeleton loader or form group if token could not be created', () => {
expect(wrapper.find(GlAlert).exists()).toBe(true); expect(wrapper.findComponent(GlAlert).exists()).toBe(true);
expect(wrapper.find(GlSkeletonLoader).exists()).toBe(false); expect(wrapper.findComponent(GlSkeletonLoader).exists()).toBe(false);
expect(wrapper.find(GlFormGroup).exists()).toBe(false); expect(wrapper.findComponent(GlFormGroup).exists()).toBe(false);
}); });
}); });
...@@ -149,9 +149,9 @@ describe('DastSiteValidationModal', () => { ...@@ -149,9 +149,9 @@ describe('DastSiteValidationModal', () => {
}); });
it('renders form groups, no alert and no skeleton loader', () => { it('renders form groups, no alert and no skeleton loader', () => {
expect(wrapper.find(GlFormGroup).exists()).toBe(true); expect(wrapper.findComponent(GlFormGroup).exists()).toBe(true);
expect(wrapper.find(GlAlert).exists()).toBe(false); expect(wrapper.findComponent(GlAlert).exists()).toBe(false);
expect(wrapper.find(GlSkeletonLoader).exists()).toBe(false); expect(wrapper.findComponent(GlSkeletonLoader).exists()).toBe(false);
}); });
it('renders a download button containing the token', () => { it('renders a download button containing the token', () => {
...@@ -275,7 +275,7 @@ describe('DastSiteValidationModal', () => { ...@@ -275,7 +275,7 @@ describe('DastSiteValidationModal', () => {
}); });
it('shows a button that copies the http-header to the clipboard', () => { it('shows a button that copies the http-header to the clipboard', () => {
const clipboardButton = wrapper.find(ModalCopyButton); const clipboardButton = wrapper.findComponent(ModalCopyButton);
expect(clipboardButton.exists()).toBe(true); expect(clipboardButton.exists()).toBe(true);
expect(clipboardButton.props()).toMatchObject({ expect(clipboardButton.props()).toMatchObject({
...@@ -310,7 +310,7 @@ describe('DastSiteValidationModal', () => { ...@@ -310,7 +310,7 @@ describe('DastSiteValidationModal', () => {
}); });
it('shows a button that copies the meta tag to the clipboard', () => { it('shows a button that copies the meta tag to the clipboard', () => {
const clipboardButton = wrapper.find(ModalCopyButton); const clipboardButton = wrapper.findComponent(ModalCopyButton);
expect(clipboardButton.exists()).toBe(true); expect(clipboardButton.exists()).toBe(true);
expect(clipboardButton.props()).toMatchObject({ expect(clipboardButton.props()).toMatchObject({
......
...@@ -60,7 +60,7 @@ describe('DastSiteValidationRevokeModal', () => { ...@@ -60,7 +60,7 @@ describe('DastSiteValidationRevokeModal', () => {
const createComponent = componentFactory(); const createComponent = componentFactory();
const createFullComponent = componentFactory(mount); const createFullComponent = componentFactory(mount);
const withinComponent = () => within(wrapper.find(GlModal).element); const withinComponent = () => within(wrapper.findComponent(GlModal).element);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"`); const findByTestId = (id) => wrapper.find(`[data-testid="${id}"`);
const findRevokeButton = () => findByTestId('revoke-validation-button'); const findRevokeButton = () => findByTestId('revoke-validation-button');
...@@ -93,7 +93,7 @@ describe('DastSiteValidationRevokeModal', () => { ...@@ -93,7 +93,7 @@ describe('DastSiteValidationRevokeModal', () => {
}); });
it('renders no alert', () => { it('renders no alert', () => {
expect(wrapper.find(GlAlert).exists()).toBe(false); expect(wrapper.findComponent(GlAlert).exists()).toBe(false);
}); });
it('renders warning message', () => { it('renders warning message', () => {
...@@ -132,7 +132,7 @@ describe('DastSiteValidationRevokeModal', () => { ...@@ -132,7 +132,7 @@ describe('DastSiteValidationRevokeModal', () => {
findRevokeButton().trigger('click'); findRevokeButton().trigger('click');
await waitForPromises(); await waitForPromises();
expect(wrapper.find(GlAlert).exists()).toBe(true); expect(wrapper.findComponent(GlAlert).exists()).toBe(true);
expect( expect(
withinComponent().getByText('Could not revoke validation. Please try again.'), withinComponent().getByText('Could not revoke validation. Please try again.'),
).not.toBe(null); ).not.toBe(null);
......
...@@ -16,7 +16,7 @@ describe('AnalyzerConfiguration component', () => { ...@@ -16,7 +16,7 @@ describe('AnalyzerConfiguration component', () => {
}; };
const findInputElement = () => wrapper.find('input[type="checkbox"]'); const findInputElement = () => wrapper.find('input[type="checkbox"]');
const findDynamicFields = () => wrapper.find(DynamicFields); const findDynamicFields = () => wrapper.findComponent(DynamicFields);
beforeEach(() => { beforeEach(() => {
[entity] = makeAnalyzerEntities(1); [entity] = makeAnalyzerEntities(1);
......
...@@ -46,7 +46,7 @@ describe('SAST Configuration App', () => { ...@@ -46,7 +46,7 @@ describe('SAST Configuration App', () => {
const findHeader = () => wrapper.find('header'); const findHeader = () => wrapper.find('header');
const findSubHeading = () => findHeader().find('p'); const findSubHeading = () => findHeader().find('p');
const findLink = (container = wrapper) => container.find(GlLink); const findLink = (container = wrapper) => container.findComponent(GlLink);
const findConfigurationForm = () => wrapper.findComponent(ConfigurationForm); const findConfigurationForm = () => wrapper.findComponent(ConfigurationForm);
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findErrorAlert = () => wrapper.findByTestId('error-alert'); const findErrorAlert = () => wrapper.findByTestId('error-alert');
...@@ -69,7 +69,7 @@ describe('SAST Configuration App', () => { ...@@ -69,7 +69,7 @@ describe('SAST Configuration App', () => {
}); });
it('links to the feedback issue', () => { it('links to the feedback issue', () => {
const link = findFeedbackAlert().find(GlLink); const link = findFeedbackAlert().findComponent(GlLink);
expect(link.attributes()).toMatchObject({ expect(link.attributes()).toMatchObject({
href: SASTConfigurationApp.feedbackIssue, href: SASTConfigurationApp.feedbackIssue,
target: '_blank', target: '_blank',
......
...@@ -65,11 +65,11 @@ describe('ConfigurationForm component', () => { ...@@ -65,11 +65,11 @@ describe('ConfigurationForm component', () => {
}; };
const findForm = () => wrapper.find('form'); const findForm = () => wrapper.find('form');
const findSubmitButton = () => wrapper.find({ ref: 'submitButton' }); const findSubmitButton = () => wrapper.findComponent({ ref: 'submitButton' });
const findErrorAlert = () => wrapper.find('[data-testid="analyzers-error-alert"]'); const findErrorAlert = () => wrapper.find('[data-testid="analyzers-error-alert"]');
const findCancelButton = () => wrapper.find({ ref: 'cancelButton' }); const findCancelButton = () => wrapper.findComponent({ ref: 'cancelButton' });
const findDynamicFieldsComponents = () => wrapper.findAll(DynamicFields); const findDynamicFieldsComponents = () => wrapper.findAllComponents(DynamicFields);
const findAnalyzerConfigurations = () => wrapper.findAll(AnalyzerConfiguration); const findAnalyzerConfigurations = () => wrapper.findAllComponents(AnalyzerConfiguration);
const findAnalyzersSection = () => wrapper.find('[data-testid="analyzers-section"]'); const findAnalyzersSection = () => wrapper.find('[data-testid="analyzers-section"]');
const findAnalyzersSectionTip = () => wrapper.find('[data-testid="analyzers-section-tip"]'); const findAnalyzersSectionTip = () => wrapper.find('[data-testid="analyzers-section-tip"]');
...@@ -177,7 +177,7 @@ describe('ConfigurationForm component', () => { ...@@ -177,7 +177,7 @@ describe('ConfigurationForm component', () => {
}); });
it('has a link to the documentation', () => { it('has a link to the documentation', () => {
const link = findAnalyzersSection().find(GlLink); const link = findAnalyzersSection().findComponent(GlLink);
expect(link.exists()).toBe(true); expect(link.exists()).toBe(true);
expect(link.attributes('href')).toBe(sastAnalyzersDocumentationPath); expect(link.attributes('href')).toBe(sastAnalyzersDocumentationPath);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment