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