summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/javascripts/commit/pipelines/pipelines_spec.js5
-rw-r--r--spec/javascripts/pipelines/pipelines_table_row_spec.js9
-rw-r--r--spec/javascripts/pipelines/pipelines_table_spec.js5
3 files changed, 11 insertions, 8 deletions
diff --git a/spec/javascripts/commit/pipelines/pipelines_spec.js b/spec/javascripts/commit/pipelines/pipelines_spec.js
index 80eb918beaf..0afe09d87bc 100644
--- a/spec/javascripts/commit/pipelines/pipelines_spec.js
+++ b/spec/javascripts/commit/pipelines/pipelines_spec.js
@@ -10,9 +10,10 @@ describe('Pipelines table in Commits and Merge requests', () => {
preloadFixtures(jsonFixtureName);
beforeEach(() => {
+ const pipelines = getJSONFixture(jsonFixtureName).pipelines;
+
PipelinesTable = Vue.extend(pipelinesTable);
- const pipelines = getJSONFixture(jsonFixtureName).pipelines; // sorted by id, descending
- pipeline = pipelines[2];
+ pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
});
describe('successful request', () => {
diff --git a/spec/javascripts/pipelines/pipelines_table_row_spec.js b/spec/javascripts/pipelines/pipelines_table_row_spec.js
index d5b9e68cc51..b3cbf9aba48 100644
--- a/spec/javascripts/pipelines/pipelines_table_row_spec.js
+++ b/spec/javascripts/pipelines/pipelines_table_row_spec.js
@@ -23,10 +23,11 @@ describe('Pipelines Table Row', () => {
preloadFixtures(jsonFixtureName);
beforeEach(() => {
- const pipelines = getJSONFixture(jsonFixtureName).pipelines; // sorted by id, descending
- pipeline = pipelines[2];
- pipelineWithoutAuthor = pipelines[1];
- pipelineWithoutCommit = pipelines[0];
+ const pipelines = getJSONFixture(jsonFixtureName).pipelines;
+
+ pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
+ pipelineWithoutAuthor = pipelines.find(p => p.user == null && p.commit !== null);
+ pipelineWithoutCommit = pipelines.find(p => p.user == null && p.commit == null);
});
afterEach(() => {
diff --git a/spec/javascripts/pipelines/pipelines_table_spec.js b/spec/javascripts/pipelines/pipelines_table_spec.js
index 3e2dfce8e17..4fc3c08145e 100644
--- a/spec/javascripts/pipelines/pipelines_table_spec.js
+++ b/spec/javascripts/pipelines/pipelines_table_spec.js
@@ -11,9 +11,10 @@ describe('Pipelines Table', () => {
preloadFixtures(jsonFixtureName);
beforeEach(() => {
+ const pipelines = getJSONFixture(jsonFixtureName).pipelines;
+
PipelinesTableComponent = Vue.extend(pipelinesTableComp);
- const pipelines = getJSONFixture(jsonFixtureName).pipelines; // ordered by id, descending
- pipeline = pipelines[2];
+ pipeline = pipelines.find(p => p.user !== null && p.commit !== null);
});
describe('table', () => {