Commit 1861df7c authored by Nick Thomas's avatar Nick Thomas

Avoid array indices to fixtures in JS specs

parent dc889d73
......@@ -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', () => {
......
......@@ -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(() => {
......
......@@ -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', () => {
......
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