Avoid array indices to fixtures in JS specs
This commit is contained in:
parent
bbe00038da
commit
2fe57353cc
3 changed files with 11 additions and 8 deletions
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in a new issue