Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/environments/environment_actions_spec.js')
-rw-r--r--spec/frontend/environments/environment_actions_spec.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/frontend/environments/environment_actions_spec.js b/spec/frontend/environments/environment_actions_spec.js
index ebdc4923045..d305f5e90bd 100644
--- a/spec/frontend/environments/environment_actions_spec.js
+++ b/spec/frontend/environments/environment_actions_spec.js
@@ -1,14 +1,22 @@
import { shallowMount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants';
import { GlLoadingIcon, GlIcon } from '@gitlab/ui';
+import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import eventHub from '~/environments/event_hub';
import EnvironmentActions from '~/environments/components/environment_actions.vue';
describe('EnvironmentActions Component', () => {
let vm;
+ const findEnvironmentActionsButton = () => vm.find('[data-testid="environment-actions-button"]');
+
beforeEach(() => {
- vm = shallowMount(EnvironmentActions, { propsData: { actions: [] } });
+ vm = shallowMount(EnvironmentActions, {
+ propsData: { actions: [] },
+ directives: {
+ GlTooltip: createMockDirective(),
+ },
+ });
});
afterEach(() => {
@@ -23,6 +31,11 @@ describe('EnvironmentActions Component', () => {
expect(vm.find('.dropdown-new').attributes('aria-label')).toEqual('Deploy to...');
});
+ it('should render a tooltip', () => {
+ const tooltip = getBinding(findEnvironmentActionsButton().element, 'gl-tooltip');
+ expect(tooltip).toBeDefined();
+ });
+
describe('is loading', () => {
beforeEach(() => {
vm.setData({ isLoading: true });