Commit 03b84967 authored by Nathan Friend's avatar Nathan Friend

Merge branch 'migrate-pipeline-store-spec' into 'master'

Migrate pipeline store spec to Jest

See merge request gitlab-org/gitlab!31140
parents 86d81d55 774adde9
......@@ -1766,7 +1766,8 @@
"name": "GitLab Docs",
"full_path": "/gitlab-com/gitlab-docs",
"full_name": "GitLab.com / GitLab Docs"
}
},
"triggered": [{}]
},
{
"id": 34993052,
......
......@@ -8,13 +8,11 @@ describe('EE Pipeline store', () => {
beforeEach(() => {
store = new PipelineStore();
data = Object.assign({}, LinkedPipelines);
});
describe('storePipeline', () => {
beforeAll(() => {
store.storePipeline(data);
});
describe('storePipeline', () => {
describe('triggered_by', () => {
it('sets triggered_by as an array', () => {
expect(store.state.pipeline.triggered_by.length).toEqual(1);
......@@ -50,10 +48,6 @@ describe('EE Pipeline store', () => {
});
describe('resetTriggeredByPipeline', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('closes the pipeline & nested ones', () => {
store.state.pipeline.triggered_by[0].isExpanded = true;
store.state.pipeline.triggered_by[0].triggered_by[0].isExpanded = true;
......@@ -66,10 +60,6 @@ describe('EE Pipeline store', () => {
});
describe('openTriggeredByPipeline', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('opens the given pipeline', () => {
store.openTriggeredByPipeline(store.state.pipeline, store.state.pipeline.triggered_by[0]);
......@@ -78,10 +68,6 @@ describe('EE Pipeline store', () => {
});
describe('closeTriggeredByPipeline', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('closes the given pipeline', () => {
// open it first
store.openTriggeredByPipeline(store.state.pipeline, store.state.pipeline.triggered_by[0]);
......@@ -93,15 +79,11 @@ describe('EE Pipeline store', () => {
});
describe('resetTriggeredPipelines', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('closes the pipeline & nested ones', () => {
store.state.pipeline.triggered[0].isExpanded = true;
store.state.pipeline.triggered[0].triggered[0].isExpanded = true;
store.resetTriggeredPipeline(store.state.pipeline, store.state.pipeline.triggered[0]);
store.resetTriggeredPipelines(store.state.pipeline, store.state.pipeline.triggered[0]);
expect(store.state.pipeline.triggered[0].isExpanded).toEqual(false);
expect(store.state.pipeline.triggered[0].triggered[0].isExpanded).toEqual(false);
......@@ -109,10 +91,6 @@ describe('EE Pipeline store', () => {
});
describe('openTriggeredPipeline', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('opens the given pipeline', () => {
store.openTriggeredPipeline(store.state.pipeline, store.state.pipeline.triggered[0]);
......@@ -121,10 +99,6 @@ describe('EE Pipeline store', () => {
});
describe('closeTriggeredPipeline', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('closes the given pipeline', () => {
// open it first
store.openTriggeredPipeline(store.state.pipeline, store.state.pipeline.triggered[0]);
......@@ -136,12 +110,8 @@ describe('EE Pipeline store', () => {
});
describe('toggleLoading', () => {
beforeEach(() => {
store.storePipeline(data);
});
it('toggles the isLoading property for the given pipeline', () => {
store.togglePipeline(store.state.pipeline.triggered[0]);
store.toggleLoading(store.state.pipeline.triggered[0]);
expect(store.state.pipeline.triggered[0].isLoading).toEqual(true);
});
......
This diff is collapsed.
{
"id": 37232567,
"user": {
"id": 113870,
"name": "Phil Hughes",
"username": "iamphill",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/533a51534470a11062df393543eab649?s=80\u0026d=identicon",
"web_url": "https://gitlab.com/iamphill",
"status_tooltip_html": null,
"path": "/iamphill"
},
"active": false,
"coverage": null,
"source": "push",
"created_at": "2018-11-20T10:22:52.617Z",
"updated_at": "2018-11-20T10:24:09.511Z",
"path": "/gitlab-org/gl-vue-cli/pipelines/37232567",
"flags": {
"latest": true,
"stuck": false,
"auto_devops": false,
"yaml_errors": false,
"retryable": false,
"cancelable": false,
"failure_reason": false
},
"details": {
"status": {
"icon": "status_success",
"text": "passed",
"label": "passed",
"group": "success",
"tooltip": "passed",
"has_details": true,
"details_path": "/gitlab-org/gl-vue-cli/pipelines/37232567",
"illustration": null,
"favicon": "https://gitlab.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png"
},
"duration": 65,
"finished_at": "2018-11-20T10:24:09.483Z",
"stages": [
{
"name": "test",
"title": "test: passed",
"groups": [
{
"name": "eslint",
"size": 1,
"status": {
"icon": "status_success",
"text": "passed",
"label": "passed",
"group": "success",
"tooltip": "passed",
"has_details": true,
"details_path": "/gitlab-org/gl-vue-cli/-/jobs/122845352",
"illustration": {
"image": "https://assets.gitlab-static.net/assets/illustrations/skipped-job_empty-8b877955fbf175e42ae65b6cb95346e15282c6fc5b682756c329af3a0055225e.svg",
"size": "svg-430",
"title": "This job does not have a trace."
},
"favicon": "https://gitlab.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png",
"action": {
"icon": "retry",
"title": "Retry",
"path": "/gitlab-org/gl-vue-cli/-/jobs/122845352/retry",
"method": "post",
"button_title": "Retry this job"
}
},
"jobs": [
{
"id": 122845352,
"name": "eslint",
"started": "2018-11-20T10:22:53.369Z",
"archived": false,
"build_path": "/gitlab-org/gl-vue-cli/-/jobs/122845352",
"retry_path": "/gitlab-org/gl-vue-cli/-/jobs/122845352/retry",
"playable": false,
"scheduled": false,
"created_at": "2018-11-20T10:22:52.630Z",
"updated_at": "2018-11-20T10:23:58.948Z",
"status": {
"icon": "status_success",
"text": "passed",
"label": "passed",
"group": "success",
"tooltip": "passed",
"has_details": true,
"details_path": "/gitlab-org/gl-vue-cli/-/jobs/122845352",
"illustration": {
"image": "https://assets.gitlab-static.net/assets/illustrations/skipped-job_empty-8b877955fbf175e42ae65b6cb95346e15282c6fc5b682756c329af3a0055225e.svg",
"size": "svg-430",
"title": "This job does not have a trace."
},
"favicon": "https://gitlab.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png",
"action": {
"icon": "retry",
"title": "Retry",
"path": "/gitlab-org/gl-vue-cli/-/jobs/122845352/retry",
"method": "post",
"button_title": "Retry this job"
}
}
}
]
}
],
"status": {
"icon": "status_success",
"text": "passed",
"label": "passed",
"group": "success",
"tooltip": "passed",
"has_details": true,
"details_path": "/gitlab-org/gl-vue-cli/pipelines/37232567#test",
"illustration": null,
"favicon": "https://gitlab.com/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png"
},
"path": "/gitlab-org/gl-vue-cli/pipelines/37232567#test",
"dropdown_path": "/gitlab-org/gl-vue-cli/pipelines/37232567/stage.json?stage=test"
}
],
"artifacts": [],
"manual_actions": [],
"scheduled_actions": []
},
"ref": {
"name": "master",
"path": "/gitlab-org/gl-vue-cli/commits/master",
"tag": false,
"branch": true
},
"commit": {
"id": "8f179601d481950bcb67032caeb33d1c24dde6bd",
"short_id": "8f179601",
"title": "Merge branch 'gl-cli-startt' into 'master'",
"created_at": "2018-11-20T10:22:51.000Z",
"parent_ids": [
"781d78fcd3d6c17ccf208f0cf0ab47c3e5397118",
"d227a0bb858c48eeee7393fcade1a33748f35183"
],
"message": "Merge branch 'gl-cli-startt' into 'master'\n\nFirst iteration of the CLI\n\nCloses gitlab-foss#53657\n\nSee merge request gitlab-org/gl-vue-cli!2",
"author_name": "Phil Hughes",
"author_email": "me@iamphill.com",
"authored_date": "2018-11-20T10:22:51.000Z",
"committer_name": "Phil Hughes",
"committer_email": "me@iamphill.com",
"committed_date": "2018-11-20T10:22:51.000Z",
"author": {
"id": 113870,
"name": "Phil Hughes",
"username": "iamphill",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/533a51534470a11062df393543eab649?s=80\u0026d=identicon",
"web_url": "https://gitlab.com/iamphill",
"status_tooltip_html": null,
"path": "/iamphill"
},
"author_gravatar_url": "https://secure.gravatar.com/avatar/533a51534470a11062df393543eab649?s=80\u0026d=identicon",
"commit_url": "https://gitlab.com/gitlab-org/gl-vue-cli/commit/8f179601d481950bcb67032caeb33d1c24dde6bd",
"commit_path": "/gitlab-org/gl-vue-cli/commit/8f179601d481950bcb67032caeb33d1c24dde6bd"
},
"triggered_by": null,
"triggered": []
}
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