提交 473addf1 编写于 作者: R Regis

bunch of blocked tests now passing - moving on

上级 20f74fe7
...@@ -38,31 +38,17 @@ ...@@ -38,31 +38,17 @@
apiScope: 'all', apiScope: 'all',
pageInfo: {}, pageInfo: {},
pagenum: 1, pagenum: 1,
count: { count: { all: 0, running_or_pending: 0 },
all: 0,
running_or_pending: 0,
},
pageRequest: false, pageRequest: false,
}; };
}, },
props: [ props: ['scope', 'store'],
'scope',
'store',
],
created() { created() {
const pagenum = getParameterByName('p'); const pagenum = getParameterByName('p');
const scope = getParameterByName('scope'); const scope = getParameterByName('scope');
if (pagenum) this.pagenum = pagenum; if (pagenum) this.pagenum = pagenum;
if (scope) this.apiScope = scope; if (scope) this.apiScope = scope;
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope);
this.store.fetchDataLoop.call(
this,
Vue,
this.pagenum,
this.scope,
this.apiScope,
);
}, },
methods: { methods: {
changepage(e) { changepage(e) {
...@@ -82,51 +68,28 @@ ...@@ -82,51 +68,28 @@
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope); this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope);
}, },
author(pipeline) { author(pipeline) {
const { commit } = pipeline; if (!pipeline.commit) return ({ avatar_url: '', web_url: '', username: '' });
if (!commit) { if (pipeline.commit.author) return pipeline.commit.author;
return ({ return ({
avatar_url: '', avatar_url: pipeline.commit.author_gravatar_url,
web_url: '', web_url: `mailto:${pipeline.commit.author_email}`,
username: '', username: pipeline.commit.author_name,
}); });
}
const author = commit.author;
if (author) return author;
const nonUser = {
avatar_url: commit.author_gravatar_url,
web_url: `mailto:${commit.author_email}`,
username: commit.author_name,
};
return nonUser;
}, },
ref(pipeline) { ref(pipeline) {
const { ref } = pipeline; const { ref } = pipeline;
const commitRef = { return ({ name: ref.name, tag: ref['tag?'], ref_url: ref.url });
name: ref.name,
tag: ref['tag?'],
ref_url: ref.url,
};
return commitRef;
},
addTimeInterval(id, start) {
this.allTimeIntervals.push({ id, start });
}, },
commitTitle(pipeline) { commitTitle(pipeline) {
const { commit } = pipeline; if (pipeline.commit) return pipeline.commit.title;
if (commit) return commit.title;
return ''; return '';
}, },
commitSha(pipeline) { commitSha(pipeline) {
const { commit } = pipeline; if (pipeline.commit) return pipeline.commit.short_id;
if (commit) return commit.short_id;
return ''; return '';
}, },
commitUrl(pipeline) { commitUrl(pipeline) {
const { commit } = pipeline; if (pipeline.commit) return pipeline.commit.commit_url;
if (commit) return commit.commit_url;
return ''; return '';
}, },
}, },
...@@ -154,10 +117,7 @@ ...@@ -154,10 +117,7 @@
</commit> </commit>
</td> </td>
<stages :pipeline='pipeline'></stages> <stages :pipeline='pipeline'></stages>
<time-ago <time-ago :pipeline='pipeline'></time-ago>
:pipeline='pipeline'
>
</time-ago>
<pipeline-actions :pipeline='pipeline'></pipeline-actions> <pipeline-actions :pipeline='pipeline'></pipeline-actions>
</tr> </tr>
</tbody> </tbody>
......
...@@ -16,28 +16,28 @@ describe "Pipelines", feature: true, js: true do ...@@ -16,28 +16,28 @@ describe "Pipelines", feature: true, js: true do
describe 'GET /:project/pipelines', feature: true, js: true do describe 'GET /:project/pipelines', feature: true, js: true do
include WaitForVueResource include WaitForVueResource
let(:project) { create(:project) }
let!(:pipeline) do let!(:pipeline) do
create( create(
:ci_empty_pipeline, :ci_empty_pipeline,
project: project, project: project,
ref: 'master', ref: 'master',
status: 'running' status: 'running',
sha: project.commit.id,
) )
end end
[:all, :running, :branches].each do |scope| [:all, :running, :branches].each do |scope|
context "displaying #{scope}" do context "displaying #{scope}" do
let(:project) { create(:project) }
before do before do
visit namespace_project_pipelines_path( visit namespace_project_pipelines_path(
project.namespace, project.namespace,
project, scope: scope project, scope: scope
) )
wait_for_vue_resource
end end
it do it do
wait_for_vue_resource
expect(page).to have_content(pipeline.short_sha) expect(page).to have_content(pipeline.short_sha)
end end
end end
...@@ -46,6 +46,7 @@ describe "Pipelines", feature: true, js: true do ...@@ -46,6 +46,7 @@ describe "Pipelines", feature: true, js: true do
context 'anonymous access' do context 'anonymous access' do
before do before do
visit namespace_project_pipelines_path(project.namespace, project) visit namespace_project_pipelines_path(project.namespace, project)
wait_for_vue_resource
end end
it { expect(page).to have_http_status(:success) } it { expect(page).to have_http_status(:success) }
...@@ -59,17 +60,12 @@ describe "Pipelines", feature: true, js: true do ...@@ -59,17 +60,12 @@ describe "Pipelines", feature: true, js: true do
before do before do
build.run build.run
visit namespace_project_pipelines_path(project.namespace, project) visit namespace_project_pipelines_path(project.namespace, project)
end
it do
wait_for_vue_resource wait_for_vue_resource
expect(page).to have_link('Cancel')
end end
it do it { expect(page).to have_link('Cancel') }
wait_for_vue_resource
expect(page).to have_selector('.ci-running') it { expect(page).to have_selector('.ci-running') }
end
context 'when canceling' do context 'when canceling' do
before do before do
...@@ -77,15 +73,9 @@ describe "Pipelines", feature: true, js: true do ...@@ -77,15 +73,9 @@ describe "Pipelines", feature: true, js: true do
click_link('Cancel') click_link('Cancel')
end end
it do it { expect(page).not_to have_link('Cancel') }
wait_for_vue_resource
expect(page).not_to have_link('Cancel')
end
it do it { expect(page).to have_selector('.ci-canceled') }
wait_for_vue_resource
expect(page).to have_selector('.ci-canceled')
end
end end
end end
...@@ -103,7 +93,10 @@ describe "Pipelines", feature: true, js: true do ...@@ -103,7 +93,10 @@ describe "Pipelines", feature: true, js: true do
it { expect(page).to have_selector('.ci-failed') } it { expect(page).to have_selector('.ci-failed') }
context 'when retrying' do context 'when retrying' do
before { click_link('Retry') } before do
wait_for_vue_resource
click_link('Retry')
end
it { expect(page).not_to have_link('Retry') } it { expect(page).not_to have_link('Retry') }
it { expect(page).to have_selector('.ci-running') } it { expect(page).to have_selector('.ci-running') }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册