Skip to content
Snippets Groups Projects
Verified Commit 2fe57353 authored by Nick Thomas's avatar Nick Thomas
Browse files

Avoid array indices to fixtures in JS specs

parent bbe00038
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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', () => {
Loading
Loading
Loading
Loading
@@ -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(() => {
Loading
Loading
Loading
Loading
@@ -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', () => {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment