Commit 6f761edc authored by Illya Klymov's avatar Illya Klymov Committed by Martin Wortschack

Add sync: false to entire codebase

This commit adds sync: false to our tests, preparing
for VTU upgrade
parent 62052283
......@@ -70,10 +70,11 @@ describe('Design management router', () => {
it('pushes designs detail component', () => {
router.push('/designs/1');
return vm.vm.$nextTick().then(() => {
const detail = vm.find(DesignDetail);
expect(detail.exists()).toBe(true);
expect(detail.props('id')).toEqual('1');
});
});
});
});
......@@ -144,8 +144,11 @@ describe('dashboard', () => {
it('should get the page info from the state', () => {
store.state.pageInfo = { totalResults: 100 };
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(ProjectSelector).props('totalResults')).toBe(100);
});
});
});
});
});
......@@ -95,10 +95,12 @@ describe('MavenInstallation', () => {
it('should track when the setup tab is clicked', () => {
setupTab().trigger('click');
return wrapper.vm.$nextTick(() => {
expect(eventSpy).toHaveBeenCalledWith(undefined, TrackingActions.REGISTRY_SETUP, {
label,
});
});
});
it('should track when the installation tab is clicked', () => {
setupTab().trigger('click');
......
......@@ -90,10 +90,12 @@ describe('NpmInstallation', () => {
it('should track when the setup tab is clicked', () => {
setupTab().trigger('click');
return wrapper.vm.$nextTick().then(() => {
expect(eventSpy).toHaveBeenCalledWith(undefined, TrackingActions.REGISTRY_SETUP, {
label,
});
});
});
it('should track when the installation tab is clicked', () => {
setupTab().trigger('click');
......
......@@ -90,16 +90,20 @@ describe('blocking mr input root', () => {
createComponent({ existingRefs: ['!1'] });
removeRef(0);
return wrapper.vm.$nextTick().then(() => {
expectShouldUpdateRefsToBe(true);
});
});
it('is true after a ref is added', () => {
createComponent();
addTokenizedInput('foo');
return wrapper.vm.$nextTick(() => {
expectShouldUpdateRefsToBe(true);
});
});
});
describe('remove_hidden_blocking_merge_requests', () => {
const expectRemoveHiddenBlockingMergeRequestsToBe = createHiddenInputExpectation(
......@@ -129,8 +133,10 @@ describe('blocking mr input root', () => {
makeComponentWithHiddenMrs();
removeRef(2);
return wrapper.vm.$nextTick().then(() => {
expectRemoveHiddenBlockingMergeRequestsToBe(true);
});
});
});
});
});
......@@ -56,9 +56,11 @@ describe('EpicsSelect', () => {
issueId: 123,
});
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.vm.$store.state.issueId).toBe(123);
});
});
});
describe('initialEpic', () => {
it('should update `selectedEpic` within state when prop is updated', () => {
......@@ -66,9 +68,11 @@ describe('EpicsSelect', () => {
initialEpic: mockEpic2,
});
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.vm.$store.state.selectedEpic).toBe(mockEpic2);
});
});
});
describe('initialEpicLoading', () => {
it('should update `selectedEpic` within state when prop is updated', () => {
......
......@@ -216,6 +216,8 @@ describe('ClusterFormDropdown', () => {
$(dropdownEl).trigger('shown.bs.dropdown');
return vm.vm.$nextTick(() => {
expect(vm.find(DropdownSearchInput).props('focused')).toBe(true);
});
});
});
......@@ -197,8 +197,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets RoleDropdown hasErrors to true when loading roles failed', () => {
rolesState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findRoleDropdown().props('hasErrors')).toEqual(true);
});
});
it('sets isLoadingRegions to RegionDropdown loading property', () => {
regionsState.isLoadingItems = true;
......@@ -215,8 +217,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets loadingRegionsError to RegionDropdown error property', () => {
regionsState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findRegionDropdown().props('hasErrors')).toEqual(true);
});
});
it('disables KeyPairDropdown when no region is selected', () => {
expect(findKeyPairDropdown().props('disabled')).toBe(true);
......@@ -245,8 +249,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets KeyPairDropdown hasErrors to true when loading key pairs fails', () => {
keyPairsState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findKeyPairDropdown().props('hasErrors')).toEqual(true);
});
});
it('disables VpcDropdown when no region is selected', () => {
expect(findVpcDropdown().props('disabled')).toBe(true);
......@@ -275,8 +281,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets VpcDropdown hasErrors to true when loading vpcs fails', () => {
vpcsState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findVpcDropdown().props('hasErrors')).toEqual(true);
});
});
it('disables SubnetDropdown when no vpc is selected', () => {
expect(findSubnetDropdown().props('disabled')).toBe(true);
......@@ -305,8 +313,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets SubnetDropdown hasErrors to true when loading subnets fails', () => {
subnetsState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findSubnetDropdown().props('hasErrors')).toEqual(true);
});
});
it('disables SecurityGroupDropdown when no vpc is selected', () => {
expect(findSecurityGroupDropdown().props('disabled')).toBe(true);
......@@ -335,8 +345,10 @@ describe('EksClusterConfigurationForm', () => {
it('sets SecurityGroupDropdown hasErrors to true when loading security groups fails', () => {
securityGroupsState.loadingItemsError = new Error();
return Vue.nextTick().then(() => {
expect(findSecurityGroupDropdown().props('hasErrors')).toEqual(true);
});
});
describe('when region is selected', () => {
const region = { name: 'us-west-2' };
......
......@@ -57,7 +57,9 @@ describe('error tracking settings app', () => {
it('disables the button when saving', () => {
store.state.settingsLoading = true;
return wrapper.vm.$nextTick(() => {
expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBeTruthy();
});
});
});
});
......@@ -24,8 +24,10 @@ describe('MR Popover', () => {
it('shows skeleton-loader while apollo is loading', () => {
wrapper.vm.$apollo.loading = true;
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.element).toMatchSnapshot();
});
});
describe('loaded state', () => {
it('matches the snapshot', () => {
......
......@@ -66,40 +66,52 @@ describe('Repository last commit component', () => {
it('renders commit widget', () => {
factory();
return vm.vm.$nextTick(() => {
expect(vm.element).toMatchSnapshot();
});
});
it('renders short commit ID', () => {
factory();
return vm.vm.$nextTick(() => {
expect(vm.find('.label-monospace').text()).toEqual('12345678');
});
});
it('hides pipeline components when pipeline does not exist', () => {
factory(createCommitData({ pipeline: null }));
return vm.vm.$nextTick(() => {
expect(vm.find('.js-commit-pipeline').exists()).toBe(false);
});
});
it('renders pipeline components', () => {
factory();
return vm.vm.$nextTick(() => {
expect(vm.find('.js-commit-pipeline').exists()).toBe(true);
});
});
it('hides author component when author does not exist', () => {
factory(createCommitData({ author: null }));
return vm.vm.$nextTick(() => {
expect(vm.find('.js-user-link').exists()).toBe(false);
expect(vm.find(UserAvatarLink).exists()).toBe(false);
});
});
it('does not render description expander when description is null', () => {
factory(createCommitData({ description: null }));
return vm.vm.$nextTick(() => {
expect(vm.find('.text-expander').exists()).toBe(false);
expect(vm.find('.commit-row-description').exists()).toBe(false);
});
});
it('expands commit description when clicking expander', () => {
factory(createCommitData({ description: 'Test description' }));
......@@ -113,6 +125,8 @@ describe('Repository last commit component', () => {
it('renders the signature HTML as returned by the backend', () => {
factory(createCommitData({ signatureHtml: '<button>Verified</button>' }));
return vm.vm.$nextTick().then(() => {
expect(vm.element).toMatchSnapshot();
});
});
});
......@@ -49,7 +49,9 @@ describe('DropdownSearchInputComponent', () => {
wrapper.setProps({ focused: true });
return wrapper.vm.$nextTick().then(() => {
expect(inputEl.focus).toHaveBeenCalled();
});
});
});
});
......@@ -147,10 +147,13 @@ describe('UserAvatarList', () => {
it('with collapse clicked, it renders avatars up to breakpoint', () => {
clickButton();
return wrapper.vm.$nextTick(() => {
const links = wrapper.findAll(UserAvatarLink);
expect(links.length).toEqual(TEST_BREAKPOINT);
});
});
});
});
});
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