Commit 32f08f89 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'find-migrate-ee-geo' into 'master'

Replace usage of find/findAll in ee/spec/frontend/geo

See merge request gitlab-org/gitlab!78645
parents d3de75ba ff9b5a37
......@@ -24,8 +24,8 @@ describe('GeoNodeFormApp', () => {
});
const findGeoNodeFormTitle = () => wrapper.find('h2');
const findGeoNodeFormBadge = () => wrapper.find(GlBadge);
const findGeoForm = () => wrapper.find(GeoNodeForm);
const findGeoNodeFormBadge = () => wrapper.findComponent(GlBadge);
const findGeoForm = () => wrapper.findComponent(GeoNodeForm);
describe('render', () => {
beforeEach(() => {
......
......@@ -50,7 +50,7 @@ describe('GeoNodeFormCapacities', () => {
});
const findGeoNodeFormCapcitiesSectionDescription = () => wrapper.find('p');
const findGeoNodeFormCapacitiesMoreInfoLink = () => wrapper.find(GlLink);
const findGeoNodeFormCapacitiesMoreInfoLink = () => wrapper.findComponent(GlLink);
const findGeoNodeFormRepositoryCapacityField = () =>
wrapper.find('#node-repository-capacity-field');
const findGeoNodeFormFileCapacityField = () => wrapper.find('#node-file-capacity-field');
......
......@@ -45,11 +45,11 @@ describe('GeoNodeFormNamespaces', () => {
wrapper.destroy();
});
const findGlDropdown = () => wrapper.find(GlDropdown);
const findGlDropdownSearch = () => findGlDropdown().find(GlSearchBoxByType);
const findGlDropdown = () => wrapper.findComponent(GlDropdown);
const findGlDropdownSearch = () => findGlDropdown().findComponent(GlSearchBoxByType);
const findDropdownItems = () => findGlDropdown().findAll('button');
const findDropdownItemsText = () => findDropdownItems().wrappers.map((w) => w.text());
const findGlIcons = () => wrapper.findAll(GlIcon);
const findGlIcons = () => wrapper.findAllComponents(GlIcon);
describe('template', () => {
beforeEach(() => {
......
......@@ -34,12 +34,12 @@ describe('GeoNodeFormSelectiveSync', () => {
});
const findGeoNodeFormSyncContainer = () =>
wrapper.find({ ref: 'geoNodeFormSelectiveSyncContainer' });
wrapper.findComponent({ ref: 'geoNodeFormSelectiveSyncContainer' });
const findGeoNodeFormSelectiveSyncMoreInfoLink = () =>
wrapper.find('[data-testid="selectiveSyncMoreInfo"]');
const findGeoNodeFormSyncTypeField = () => wrapper.find('#node-selective-synchronization-field');
const findGeoNodeFormNamespacesField = () => wrapper.find(GeoNodeFormNamespaces);
const findGeoNodeFormShardsField = () => wrapper.find(GeoNodeFormShards);
const findGeoNodeFormNamespacesField = () => wrapper.findComponent(GeoNodeFormNamespaces);
const findGeoNodeFormShardsField = () => wrapper.findComponent(GeoNodeFormShards);
const findGeoNodeObjectStorageField = () => wrapper.find('#node-object-storage-field');
const findGeoNodeFormObjectStorageMoreInformation = () =>
wrapper.find('[data-testid="objectStorageMoreInfo"]');
......
......@@ -24,7 +24,7 @@ describe('GeoNodeFormShards', () => {
wrapper.destroy();
});
const findGlDropdown = () => wrapper.find(GlDropdown);
const findGlDropdown = () => wrapper.findComponent(GlDropdown);
const findDropdownItems = () => findGlDropdown().findAll('li');
describe('template', () => {
......@@ -55,7 +55,7 @@ describe('GeoNodeFormShards', () => {
const dropdownItems = findDropdownItems();
dropdownItems.wrappers.forEach((dI, index) => {
const dropdownItemIcon = dI.find(GlIcon);
const dropdownItemIcon = dI.findComponent(GlIcon);
expect(dropdownItemIcon.classes('invisible')).toBe(
!wrapper.vm.isSelected(wrapper.vm.syncShardsOptions[index]),
......
......@@ -41,9 +41,9 @@ describe('GeoNodeForm', () => {
wrapper.destroy();
});
const findGeoNodeFormCoreField = () => wrapper.find(GeoNodeFormCore);
const findGeoNodeFormSelectiveSyncField = () => wrapper.find(GeoNodeFormSelectiveSync);
const findGeoNodeFormCapacitiesField = () => wrapper.find(GeoNodeFormCapacities);
const findGeoNodeFormCoreField = () => wrapper.findComponent(GeoNodeFormCore);
const findGeoNodeFormSelectiveSyncField = () => wrapper.findComponent(GeoNodeFormSelectiveSync);
const findGeoNodeFormCapacitiesField = () => wrapper.findComponent(GeoNodeFormCapacities);
const findGeoNodeSaveButton = () => wrapper.find('#node-save-button');
const findGeoNodeCancelButton = () => wrapper.find('#node-cancel-button');
......
......@@ -97,7 +97,7 @@ describe('GeoNodeReplicationDetailsResponsive', () => {
it('renders sync progress correctly', () => {
expect(
findFirstReplicationDetailsItemSyncStatus().find(GeoNodeProgressBar).exists(),
findFirstReplicationDetailsItemSyncStatus().findComponent(GeoNodeProgressBar).exists(),
).toBe(renderSyncProgress);
expect(
extendedWrapper(findFirstReplicationDetailsItemSyncStatus()).findByText('N/A').exists(),
......@@ -106,7 +106,7 @@ describe('GeoNodeReplicationDetailsResponsive', () => {
it('renders verification progress correctly', () => {
expect(
findFirstReplicationDetailsItemVerifStatus().find(GeoNodeProgressBar).exists(),
findFirstReplicationDetailsItemVerifStatus().findComponent(GeoNodeProgressBar).exists(),
).toBe(renderVerifProgress);
expect(
extendedWrapper(findFirstReplicationDetailsItemVerifStatus())
......
......@@ -50,14 +50,16 @@ describe('GeoNodeReplicationStatusMobile', () => {
});
it('renders sync progress correctly', () => {
expect(findItemSyncStatus().find(GeoNodeProgressBar).exists()).toBe(renderSyncProgress);
expect(findItemSyncStatus().findComponent(GeoNodeProgressBar).exists()).toBe(
renderSyncProgress,
);
expect(extendedWrapper(findItemSyncStatus()).findByText('N/A').exists()).toBe(
!renderSyncProgress,
);
});
it('renders verification progress correctly', () => {
expect(findItemVerificationStatus().find(GeoNodeProgressBar).exists()).toBe(
expect(findItemVerificationStatus().findComponent(GeoNodeProgressBar).exists()).toBe(
renderVerifProgress,
);
expect(extendedWrapper(findItemVerificationStatus()).findByText('N/A').exists()).toBe(
......
......@@ -28,7 +28,7 @@ describe('GeoNodeReplicationStatus', () => {
});
const findReplicationStatusText = () => wrapper.findByTestId('replication-status-text');
const findQuestionIcon = () => wrapper.find({ ref: 'replicationStatus' });
const findQuestionIcon = () => wrapper.findComponent({ ref: 'replicationStatus' });
const findGlPopover = () => wrapper.findComponent(GlPopover);
const findGlPopoverLink = () => findGlPopover().findComponent(GlLink);
......
......@@ -51,7 +51,7 @@ describe('GeoNodeLastUpdated', () => {
it('renders main text correctly', () => {
expect(findMainText().exists()).toBe(true);
expect(findMainText().find(TimeAgo).props('time')).toBe(staleStatusTime);
expect(findMainText().findComponent(TimeAgo).props('time')).toBe(staleStatusTime);
});
it('renders the question icon correctly', () => {
......@@ -65,7 +65,7 @@ describe('GeoNodeLastUpdated', () => {
it('renders the popover text correctly', () => {
expect(findPopoverText().exists()).toBe(true);
expect(findPopoverText().find(TimeAgo).props('time')).toBe(staleStatusTime);
expect(findPopoverText().findComponent(TimeAgo).props('time')).toBe(staleStatusTime);
});
it('renders the popover link always', () => {
......
......@@ -44,12 +44,12 @@ describe('GeoReplicableApp', () => {
});
const findGeoReplicableContainer = () => wrapper.find('.geo-replicable-container');
const findGlLoadingIcon = () => findGeoReplicableContainer().find(GlLoadingIcon);
const findGeoReplicable = () => findGeoReplicableContainer().find(GeoReplicable);
const findGlLoadingIcon = () => findGeoReplicableContainer().findComponent(GlLoadingIcon);
const findGeoReplicable = () => findGeoReplicableContainer().findComponent(GeoReplicable);
const findGeoReplicableEmptyState = () =>
findGeoReplicableContainer().find(GeoReplicableEmptyState);
findGeoReplicableContainer().findComponent(GeoReplicableEmptyState);
const findGeoReplicableFilterBar = () =>
findGeoReplicableContainer().find(GeoReplicableFilterBar);
findGeoReplicableContainer().findComponent(GeoReplicableFilterBar);
describe.each`
isLoading | graphqlFieldName | replicableItems | showReplicableItems | showEmptyState | showFilterBar | showLoader
......
......@@ -47,8 +47,8 @@ describe('GeoReplicableItem', () => {
});
const findCard = () => wrapper.find('.card');
const findGlLink = () => findCard().find(GlLink);
const findGlButton = () => findCard().find(GlButton);
const findGlLink = () => findCard().findComponent(GlLink);
const findGlButton = () => findCard().findComponent(GlButton);
const findCardHeader = () => findCard().find('.card-header');
const findTextTitle = () => findCardHeader().find('span');
const findCardBody = () => findCard().find('.card-body');
......
......@@ -39,8 +39,9 @@ describe('GeoReplicable', () => {
});
const findGeoReplicableContainer = () => wrapper.find('section');
const findGlPagination = () => findGeoReplicableContainer().find(GlPagination);
const findGeoReplicableItem = () => findGeoReplicableContainer().findAll(GeoReplicableItem);
const findGlPagination = () => findGeoReplicableContainer().findComponent(GlPagination);
const findGeoReplicableItem = () =>
findGeoReplicableContainer().findAllComponents(GeoReplicableItem);
describe('template', () => {
beforeEach(() => {
......
......@@ -34,7 +34,7 @@ describe('GeoReplicableStatus', () => {
});
const findGeoReplicableStatusContainer = () => wrapper.find('div');
const findIcon = () => findGeoReplicableStatusContainer().find(GlIcon);
const findIcon = () => findGeoReplicableStatusContainer().findComponent(GlIcon);
describe('template', () => {
beforeEach(() => {
......
......@@ -30,8 +30,8 @@ describe('GeoReplicableTimeAgo', () => {
wrapper.destroy();
});
const findGeoReplicableTimeAgo = () => wrapper.find(GeoReplicableTimeAgo);
const findTimeAgo = () => findGeoReplicableTimeAgo().find(TimeAgo);
const findGeoReplicableTimeAgo = () => wrapper.findComponent(GeoReplicableTimeAgo);
const findTimeAgo = () => findGeoReplicableTimeAgo().findComponent(TimeAgo);
const findDefaultText = () => findGeoReplicableTimeAgo().find('span');
describe('template', () => {
......
......@@ -30,8 +30,8 @@ describe('GeoSettingsApp', () => {
});
const findGeoSettingsContainer = () => wrapper.find('[data-testid="geoSettingsContainer"]');
const containsGeoSettingsForm = () => wrapper.find(GeoSettingsForm).exists();
const containsGlLoadingIcon = () => wrapper.find(GlLoadingIcon).exists();
const containsGeoSettingsForm = () => wrapper.findComponent(GeoSettingsForm).exists();
const containsGlLoadingIcon = () => wrapper.findComponent(GlLoadingIcon).exists();
describe('renders', () => {
beforeEach(() => {
......
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