Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Luís <aluis@gitlab.com>2018-05-22 15:52:37 +0300
committerAndré Luís <aluis@gitlab.com>2018-05-24 19:39:13 +0300
commitb7e4bd344b6d4250eee00b486079abc889897545 (patch)
tree6f31436222d7de7f59d97a54ac32e77629d752f9
parentcb943b0c6bc75d85fc1cc98301c7591bd9275909 (diff)
Update tests for latest bugfix
-rw-r--r--app/assets/javascripts/ide/stores/actions/project.js5
-rw-r--r--spec/javascripts/ide/mock_data.js6
-rw-r--r--spec/javascripts/ide/stores/actions/project_spec.js9
3 files changed, 15 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js
index 53c36193494..cece9154c82 100644
--- a/app/assets/javascripts/ide/stores/actions/project.js
+++ b/app/assets/javascripts/ide/stores/actions/project.js
@@ -92,9 +92,10 @@ export const refreshLastCommitData = ({ commit, state, dispatch }, { projectId,
flash(__('Error loading last commit.'), 'alert', document, null, false, true);
});
-export const pollSuccessCallBack = ({ commit, state, dispatch, getters }, { data }) => {
+export const pollSuccessCallBack = ({ commit, state, dispatch }, { data }) => {
if (data.pipelines && data.pipelines.length) {
- const lastCommitHash = getters.lastCommit.id;
+ const lastCommitHash =
+ state.projects[state.currentProjectId].branches[state.currentBranchId].commit.id;
const lastCommitPipeline = data.pipelines.find(
pipeline => pipeline.commit.id === lastCommitHash,
);
diff --git a/spec/javascripts/ide/mock_data.js b/spec/javascripts/ide/mock_data.js
index 341a3fdb14c..c68ae050641 100644
--- a/spec/javascripts/ide/mock_data.js
+++ b/spec/javascripts/ide/mock_data.js
@@ -68,6 +68,9 @@ export const fullPipelinesResponse = {
pipelines: [
{
id: '51',
+ commit: {
+ id: 'xxxxxxxxxxxxxxxxxxxx',
+ },
details: {
status: {
icon: 'status_failed',
@@ -77,6 +80,9 @@ export const fullPipelinesResponse = {
},
{
id: '50',
+ commit: {
+ id: 'abc123def456ghi789jkl',
+ },
details: {
status: {
icon: 'status_passed',
diff --git a/spec/javascripts/ide/stores/actions/project_spec.js b/spec/javascripts/ide/stores/actions/project_spec.js
index 9e57353d396..66f2ebdffc3 100644
--- a/spec/javascripts/ide/stores/actions/project_spec.js
+++ b/spec/javascripts/ide/stores/actions/project_spec.js
@@ -171,11 +171,14 @@ describe('IDE store project actions', () => {
projectId: 'abc/def',
branchId: 'master',
pipeline: {
- id: '51',
+ id: '50',
+ commit: {
+ id: 'abc123def456ghi789jkl',
+ },
details: {
status: {
- icon: 'status_failed',
- text: 'failed',
+ icon: 'status_passed',
+ text: 'passed',
},
},
},