Commit e4b61b7c authored by Natalia Tepluhina's avatar Natalia Tepluhina

Fix environment_app spec and pipelines_table spec

parent bda7a261
...@@ -182,7 +182,7 @@ describe('Environment', () => { ...@@ -182,7 +182,7 @@ describe('Environment', () => {
describe('when user can create environment', () => { describe('when user can create environment', () => {
beforeEach(() => { beforeEach(() => {
mockRequest([environment]); mockRequest([environment]);
wrapper = mount(EnvironmentsApp, { propsData: mockData }); wrapper = shallowMount(EnvironmentsApp, { propsData: mockData });
}); });
it('should render', () => { it('should render', () => {
...@@ -193,7 +193,7 @@ describe('Environment', () => { ...@@ -193,7 +193,7 @@ describe('Environment', () => {
describe('when user can not create environment', () => { describe('when user can not create environment', () => {
beforeEach(() => { beforeEach(() => {
mockRequest([environment]); mockRequest([environment]);
wrapper = mount(EnvironmentsApp, { wrapper = shallowMount(EnvironmentsApp, {
propsData: { ...mockData, canCreateEnvironment: false }, propsData: { ...mockData, canCreateEnvironment: false },
}); });
}); });
......
import { GlButton } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import PipelinesTable from '~/pipelines/components/pipelines_list/pipelines_table.vue'; import PipelinesTable from '~/pipelines/components/pipelines_list/pipelines_table.vue';
...@@ -20,7 +19,6 @@ describe('Pipelines Table', () => { ...@@ -20,7 +19,6 @@ describe('Pipelines Table', () => {
}); });
}; };
const findRows = () => wrapper.findAll('.commit.gl-responsive-table-row'); const findRows = () => wrapper.findAll('.commit.gl-responsive-table-row');
const findGlButtons = () => wrapper.findAll(GlButton);
preloadFixtures(jsonFixtureName); preloadFixtures(jsonFixtureName);
...@@ -65,28 +63,4 @@ describe('Pipelines Table', () => { ...@@ -65,28 +63,4 @@ describe('Pipelines Table', () => {
expect(findRows()).toHaveLength(1); expect(findRows()).toHaveLength(1);
}); });
}); });
describe('pipline actions', () => {
it('should set the "Re-deploy" title', () => {
const pipelines = [{ ...pipeline, flags: { cancelable: false, retryable: true } }];
createComponent({ ...defaultProps, pipelines });
expect(findGlButtons().length).toBe(1);
expect(
findGlButtons()
.at(0)
.attributes('title'),
).toMatch('Retry');
});
it('should set the "Cancel" title', () => {
const pipelines = [{ ...pipeline, flags: { cancelable: true, retryable: false } }];
createComponent({ ...defaultProps, pipelines });
expect(findGlButtons().length).toBe(1);
expect(
findGlButtons()
.at(0)
.attributes('title'),
).toMatch('Cancel');
});
});
}); });
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