diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-24 00:10:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-24 00:10:25 +0000 |
commit | b2e2c43b3c5aebf47d7f6114b172551e4fa97e58 (patch) | |
tree | 5358eb8e4b7fa85f87f13524ab520b460a62ce24 /spec/frontend/packages | |
parent | 5838993b5f3e2d861d9dd7c82dfeea71506b9fc2 (diff) | |
download | gitlab-ce-b2e2c43b3c5aebf47d7f6114b172551e4fa97e58.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/packages')
7 files changed, 30 insertions, 30 deletions
diff --git a/spec/frontend/packages/details/components/additional_metadata_spec.js b/spec/frontend/packages/details/components/additional_metadata_spec.js index 111e4205abb..8466a630ecb 100644 --- a/spec/frontend/packages/details/components/additional_metadata_spec.js +++ b/spec/frontend/packages/details/components/additional_metadata_spec.js @@ -11,7 +11,7 @@ describe('Package Additional Metadata', () => { packageEntity: { ...mavenPackage }, }; - const mountComponent = props => { + const mountComponent = (props) => { wrapper = shallowMount(component, { propsData: { ...defaultProps, ...props }, stubs: { @@ -33,7 +33,7 @@ describe('Package Additional Metadata', () => { const findConanRecipe = () => wrapper.find('[data-testid="conan-recipe"]'); const findMavenApp = () => wrapper.find('[data-testid="maven-app"]'); const findMavenGroup = () => wrapper.find('[data-testid="maven-group"]'); - const findElementLink = container => container.find(GlLink); + const findElementLink = (container) => container.find(GlLink); it('has the correct title', () => { mountComponent(); diff --git a/spec/frontend/packages/details/components/package_history_spec.js b/spec/frontend/packages/details/components/package_history_spec.js index c43ac9b9c40..5a6b386e2ca 100644 --- a/spec/frontend/packages/details/components/package_history_spec.js +++ b/spec/frontend/packages/details/components/package_history_spec.js @@ -15,10 +15,10 @@ describe('Package History', () => { packageEntity: { ...mavenPackage }, }; - const createPipelines = amount => + const createPipelines = (amount) => [...Array(amount)].map((x, index) => ({ ...mockPipelineInfo, id: index + 1 })); - const mountComponent = props => { + const mountComponent = (props) => { wrapper = shallowMount(component, { propsData: { ...defaultProps, ...props }, stubs: { @@ -35,9 +35,9 @@ describe('Package History', () => { wrapper = null; }); - const findHistoryElement = testId => wrapper.find(`[data-testid="${testId}"]`); - const findElementLink = container => container.find(GlLink); - const findElementTimeAgo = container => container.find(TimeAgoTooltip); + const findHistoryElement = (testId) => wrapper.find(`[data-testid="${testId}"]`); + const findElementLink = (container) => container.find(GlLink); + const findElementTimeAgo = (container) => container.find(TimeAgoTooltip); const findTitle = () => wrapper.find('[data-testid="title"]'); const findTimeline = () => wrapper.find('[data-testid="timeline"]'); diff --git a/spec/frontend/packages/details/store/actions_spec.js b/spec/frontend/packages/details/store/actions_spec.js index 96fcf90b0fb..e823a00ebc4 100644 --- a/spec/frontend/packages/details/store/actions_spec.js +++ b/spec/frontend/packages/details/store/actions_spec.js @@ -12,7 +12,7 @@ jest.mock('~/api.js'); describe('Actions Package details store', () => { describe('fetchPackageVersions', () => { - it('should fetch the package versions', done => { + it('should fetch the package versions', (done) => { Api.projectPackage = jest.fn().mockResolvedValue({ data: packageEntity }); testAction( @@ -35,7 +35,7 @@ describe('Actions Package details store', () => { ); }); - it("does not set the versions if they don't exist", done => { + it("does not set the versions if they don't exist", (done) => { Api.projectPackage = jest.fn().mockResolvedValue({ data: { packageEntity, versions: null } }); testAction( @@ -57,7 +57,7 @@ describe('Actions Package details store', () => { ); }); - it('should create flash on API error', done => { + it('should create flash on API error', (done) => { Api.projectPackage = jest.fn().mockRejectedValue(); testAction( @@ -82,7 +82,7 @@ describe('Actions Package details store', () => { }); describe('deletePackage', () => { - it('should call Api.deleteProjectPackage', done => { + it('should call Api.deleteProjectPackage', (done) => { Api.deleteProjectPackage = jest.fn().mockResolvedValue(); testAction(deletePackage, undefined, { packageEntity }, [], [], () => { expect(Api.deleteProjectPackage).toHaveBeenCalledWith( @@ -92,7 +92,7 @@ describe('Actions Package details store', () => { done(); }); }); - it('should create flash on API error', done => { + it('should create flash on API error', (done) => { Api.deleteProjectPackage = jest.fn().mockRejectedValue(); testAction(deletePackage, undefined, { packageEntity }, [], [], () => { diff --git a/spec/frontend/packages/list/components/packages_sort_spec.js b/spec/frontend/packages/list/components/packages_sort_spec.js index 5c4794d8f63..d15ad9bd542 100644 --- a/spec/frontend/packages/list/components/packages_sort_spec.js +++ b/spec/frontend/packages/list/components/packages_sort_spec.js @@ -16,7 +16,7 @@ describe('packages_sort', () => { const findPackageListSorting = () => wrapper.find(GlSorting); const findSortingItems = () => wrapper.findAll(GlSortingItem); - const createStore = isGroupPage => { + const createStore = (isGroupPage) => { const state = { config: { isGroupPage, diff --git a/spec/frontend/packages/list/stores/actions_spec.js b/spec/frontend/packages/list/stores/actions_spec.js index 71b4d07a8af..05e1fe57cae 100644 --- a/spec/frontend/packages/list/stores/actions_spec.js +++ b/spec/frontend/packages/list/stores/actions_spec.js @@ -30,7 +30,7 @@ describe('Actions Package list store', () => { sort: 'asc', orderBy: 'version', }; - it('should fetch the project packages list when isGroupPage is false', done => { + it('should fetch the project packages list when isGroupPage is false', (done) => { testAction( actions.requestPackagesList, undefined, @@ -50,7 +50,7 @@ describe('Actions Package list store', () => { ); }); - it('should fetch the group packages list when isGroupPage is true', done => { + it('should fetch the group packages list when isGroupPage is true', (done) => { testAction( actions.requestPackagesList, undefined, @@ -70,7 +70,7 @@ describe('Actions Package list store', () => { ); }); - it('should fetch packages of a certain type when selectedType is present', done => { + it('should fetch packages of a certain type when selectedType is present', (done) => { const packageType = 'maven'; testAction( @@ -102,7 +102,7 @@ describe('Actions Package list store', () => { ); }); - it('should create flash on API error', done => { + it('should create flash on API error', (done) => { Api.projectPackages = jest.fn().mockRejectedValue(); testAction( actions.requestPackagesList, @@ -122,7 +122,7 @@ describe('Actions Package list store', () => { }); describe('receivePackagesListSuccess', () => { - it('should set received packages', done => { + it('should set received packages', (done) => { const data = 'foo'; testAction( @@ -140,7 +140,7 @@ describe('Actions Package list store', () => { }); describe('setInitialState', () => { - it('should commit setInitialState', done => { + it('should commit setInitialState', (done) => { testAction( actions.setInitialState, '1', @@ -153,7 +153,7 @@ describe('Actions Package list store', () => { }); describe('setLoading', () => { - it('should commit set main loading', done => { + it('should commit set main loading', (done) => { testAction( actions.setLoading, true, @@ -171,7 +171,7 @@ describe('Actions Package list store', () => { delete_api_path: 'foo', }, }; - it('should perform a delete operation on _links.delete_api_path', done => { + it('should perform a delete operation on _links.delete_api_path', (done) => { mock.onDelete(payload._links.delete_api_path).replyOnce(200); Api.projectPackages = jest.fn().mockResolvedValue({ data: 'foo' }); @@ -188,7 +188,7 @@ describe('Actions Package list store', () => { ); }); - it('should stop the loading and call create flash on api error', done => { + it('should stop the loading and call create flash on api error', (done) => { mock.onDelete(payload._links.delete_api_path).replyOnce(400); testAction( actions.requestDeletePackage, @@ -211,7 +211,7 @@ describe('Actions Package list store', () => { ${'_links'} | ${{}} ${'delete_api_path'} | ${{ _links: {} }} `('should reject and createFlash when $property is missing', ({ actionPayload }, done) => { - testAction(actions.requestDeletePackage, actionPayload, null, [], []).catch(e => { + testAction(actions.requestDeletePackage, actionPayload, null, [], []).catch((e) => { expect(e).toEqual(new Error(MISSING_DELETE_PATH_ERROR)); expect(createFlash).toHaveBeenCalledWith(DELETE_PACKAGE_ERROR_MESSAGE); done(); @@ -220,7 +220,7 @@ describe('Actions Package list store', () => { }); describe('setSorting', () => { - it('should commit SET_SORTING', done => { + it('should commit SET_SORTING', (done) => { testAction( actions.setSorting, 'foo', @@ -233,7 +233,7 @@ describe('Actions Package list store', () => { }); describe('setFilter', () => { - it('should commit SET_FILTER', done => { + it('should commit SET_FILTER', (done) => { testAction( actions.setFilter, 'foo', diff --git a/spec/frontend/packages/shared/components/package_path_spec.js b/spec/frontend/packages/shared/components/package_path_spec.js index 40d455ac77c..3c9cd3387ba 100644 --- a/spec/frontend/packages/shared/components/package_path_spec.js +++ b/spec/frontend/packages/shared/components/package_path_spec.js @@ -21,8 +21,8 @@ describe('PackagePath', () => { const ELLIPSIS_CHEVRON = 'ellipsis-chevron'; const LEAF_LINK = 'leaf-link'; - const findItem = name => wrapper.find(`[data-testid="${name}"]`); - const findTooltip = w => getBinding(w.element, 'gl-tooltip'); + const findItem = (name) => wrapper.find(`[data-testid="${name}"]`); + const findTooltip = (w) => getBinding(w.element, 'gl-tooltip'); afterEach(() => { wrapper.destroy(); @@ -64,13 +64,13 @@ describe('PackagePath', () => { } if (shouldExist.length) { - it.each(shouldExist)(`should have %s`, element => { + it.each(shouldExist)(`should have %s`, (element) => { expect(findItem(element).exists()).toBe(true); }); } if (shouldNotExist.length) { - it.each(shouldNotExist)(`should not have %s`, element => { + it.each(shouldNotExist)(`should not have %s`, (element) => { expect(findItem(element).exists()).toBe(false); }); } diff --git a/spec/frontend/packages/shared/utils_spec.js b/spec/frontend/packages/shared/utils_spec.js index 3e4ce8eb323..590e3814bee 100644 --- a/spec/frontend/packages/shared/utils_spec.js +++ b/spec/frontend/packages/shared/utils_spec.js @@ -13,7 +13,7 @@ describe('Packages shared utils', () => { expect(packageTypeToTrackCategory()).toMatchInlineSnapshot(`"UI::undefined"`); }); - it.each(Object.keys(PackageType))('returns a correct category string for %s', packageKey => { + it.each(Object.keys(PackageType))('returns a correct category string for %s', (packageKey) => { const packageName = PackageType[packageKey]; expect(packageTypeToTrackCategory(packageName)).toBe( `UI::${TrackingCategories[packageName]}`, |