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

bunch of blocked tests now passing - moving on

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