Avoid array indices to fixtures in JS specs

This commit is contained in:
Nick Thomas 2018-01-24 18:36:54 +00:00
parent bbe00038da
commit 2fe57353cc
No known key found for this signature in database
GPG key ID: 2A313A47AFADACE9
3 changed files with 11 additions and 8 deletions

View file

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

View file

@ -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(() => {

View file

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