summaryrefslogtreecommitdiff
path: root/spec/frontend
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 00:32:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-01-08 00:32:37 +0000
commit469a50879c1085ec77c95d650b7f135fee2c9e13 (patch)
tree0d639a63294b5abdb4e4a7bf1ed5a497d5e6869f /spec/frontend
parentaa5ca44f172f02f04cca448b1f9c17d6d933de40 (diff)
downloadgitlab-ce-469a50879c1085ec77c95d650b7f135fee2c9e13.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/jobs/store/actions_spec.js66
-rw-r--r--spec/frontend/jobs/store/mutations_spec.js1
-rw-r--r--spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js14
-rw-r--r--spec/frontend/registry/explorer/mock_data.js4
4 files changed, 12 insertions, 73 deletions
diff --git a/spec/frontend/jobs/store/actions_spec.js b/spec/frontend/jobs/store/actions_spec.js
index 26547d12ac7..91bd5521f70 100644
--- a/spec/frontend/jobs/store/actions_spec.js
+++ b/spec/frontend/jobs/store/actions_spec.js
@@ -27,7 +27,6 @@ import {
hideSidebar,
showSidebar,
toggleSidebar,
- triggerManualJob,
} from '~/jobs/store/actions';
import state from '~/jobs/store/state';
import * as types from '~/jobs/store/mutation_types';
@@ -159,32 +158,6 @@ describe('Job State actions', () => {
);
});
});
-
- it('fetchTrace is called only if the job has started or has a trace', done => {
- mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 121212, name: 'karma' });
-
- mockedState.job.started = true;
-
- testAction(
- fetchJob,
- null,
- mockedState,
- [],
- [
- {
- type: 'requestJob',
- },
- {
- payload: { id: 121212, name: 'karma' },
- type: 'receiveJobSuccess',
- },
- {
- type: 'fetchTrace',
- },
- ],
- done,
- );
- });
});
describe('receiveJobSuccess', () => {
@@ -536,43 +509,4 @@ describe('Job State actions', () => {
);
});
});
-
- describe('triggerManualJob', () => {
- let mock;
-
- beforeEach(() => {
- mock = new MockAdapter(axios);
- });
-
- afterEach(() => {
- mock.restore();
- });
-
- it('should dispatch fetchTrace', done => {
- const playManualJobEndpoint = `${TEST_HOST}/manual-job/jobs/1000/play`;
-
- mock.onPost(playManualJobEndpoint).reply(200);
-
- mockedState.job = {
- status: {
- action: {
- path: playManualJobEndpoint,
- },
- },
- };
-
- testAction(
- triggerManualJob,
- [{ id: '1', key: 'test_var', secret_value: 'test_value' }],
- mockedState,
- [],
- [
- {
- type: 'fetchTrace',
- },
- ],
- done,
- );
- });
- });
});
diff --git a/spec/frontend/jobs/store/mutations_spec.js b/spec/frontend/jobs/store/mutations_spec.js
index a8146ba93eb..608abc8f7c4 100644
--- a/spec/frontend/jobs/store/mutations_spec.js
+++ b/spec/frontend/jobs/store/mutations_spec.js
@@ -153,7 +153,6 @@ describe('Jobs Store Mutations', () => {
mutations[types.SET_TRACE_TIMEOUT](stateCopy, id);
expect(stateCopy.traceTimeout).toEqual(id);
- expect(stateCopy.isTraceComplete).toBe(false);
});
});
diff --git a/spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js b/spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
index e1b75636735..94944643e8b 100644
--- a/spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
+++ b/spec/frontend/registry/explorer/components/details_page/tags_list_row_spec.js
@@ -172,25 +172,31 @@ describe('tags list row', () => {
});
it('contains the totalSize and layers', () => {
- mountComponent({ ...defaultProps, tag: { ...tag, totalSize: 1024, layers: 10 } });
+ mountComponent({ ...defaultProps, tag: { ...tag, totalSize: '1024', layers: 10 } });
expect(findSize().text()).toMatchInterpolatedText('1.00 KiB · 10 layers');
});
+ it('when totalSize is giantic', () => {
+ mountComponent({ ...defaultProps, tag: { ...tag, totalSize: '1099511627776', layers: 2 } });
+
+ expect(findSize().text()).toMatchInterpolatedText('1024.00 GiB · 2 layers');
+ });
+
it('when totalSize is missing', () => {
- mountComponent({ ...defaultProps, tag: { ...tag, totalSize: 0, layers: 10 } });
+ mountComponent({ ...defaultProps, tag: { ...tag, totalSize: '0', layers: 10 } });
expect(findSize().text()).toMatchInterpolatedText(`${NOT_AVAILABLE_SIZE} · 10 layers`);
});
it('when layers are missing', () => {
- mountComponent({ ...defaultProps, tag: { ...tag, totalSize: 1024 } });
+ mountComponent({ ...defaultProps, tag: { ...tag, totalSize: '1024' } });
expect(findSize().text()).toMatchInterpolatedText('1.00 KiB');
});
it('when there is 1 layer', () => {
- mountComponent({ ...defaultProps, tag: { ...tag, totalSize: 0, layers: 1 } });
+ mountComponent({ ...defaultProps, tag: { ...tag, totalSize: '0', layers: 1 } });
expect(findSize().text()).toMatchInterpolatedText(`${NOT_AVAILABLE_SIZE} · 1 layer`);
});
diff --git a/spec/frontend/registry/explorer/mock_data.js b/spec/frontend/registry/explorer/mock_data.js
index 992d880581a..72a9bff8a47 100644
--- a/spec/frontend/registry/explorer/mock_data.js
+++ b/spec/frontend/registry/explorer/mock_data.js
@@ -140,7 +140,7 @@ export const tagsMock = [
revision: 'c2613843ab33aabf847965442b13a8b55a56ae28837ce182627c0716eb08c02b',
shortRevision: 'c2613843a',
createdAt: '2020-11-03T13:29:38+00:00',
- totalSize: 105,
+ totalSize: '1099511627776',
canDelete: true,
__typename: 'ContainerRepositoryTag',
},
@@ -152,7 +152,7 @@ export const tagsMock = [
revision: 'df44e7228f0f255c73e35b6f0699624a615f42746e3e8e2e4b3804a6d6fc3292',
shortRevision: 'df44e7228',
createdAt: '2020-11-03T13:29:32+00:00',
- totalSize: 104,
+ totalSize: '536870912000',
canDelete: true,
__typename: 'ContainerRepositoryTag',
},