Commit 401a2ec0 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds tests to prevent future errors.

Fix undefined variable in es5
parent 7c9a85e3
......@@ -16,7 +16,7 @@
addMarginToBuildColumns() {
this.pipelineGraph = document.querySelector('.pipeline-graph');
const secondChildBuildNodes = document.querySelector('.pipeline-graph').querySelectorAll('.build:nth-child(2)');
for (buildNodeIndex in secondChildBuildNodes) {
for (const buildNodeIndex in secondChildBuildNodes) {
const buildNode = secondChildBuildNodes[buildNodeIndex];
const firstChildBuildNode = buildNode.previousElementSibling;
if (!firstChildBuildNode || !firstChildBuildNode.matches('.build')) continue;
......
---
title: Fix TypeError: Cannot read property 'initTabs' on commit builds tab
merge_request:
merge_request: 8009
author:
%div.pipeline-visualization.pipeline-graph
%ul.stage-column-list
%li.stage-column
.stage-name
%a{:href => "/"}
Test
.builds-container
%ul
%li.build
.curve
.build-content
%a
%svg
.ci-status-text
stop_review
//= require pipelines
(() => {
describe('Pipelines', () => {
fixture.preload('pipeline_graph');
beforeEach(() => {
fixture.load('pipeline_graph');
});
it('should be defined', () => {
expect(window.gl.Pipelines).toBeDefined();
});
it('should create a `Pipelines` instance without options', () => {
expect(() => { new window.gl.Pipelines(); }).not.toThrow(); //eslint-disable-line
});
it('should create a `Pipelines` instance with options', () => {
const pipelines = new window.gl.Pipelines({ foo: 'bar' });
expect(pipelines.pipelineGraph).toBeDefined();
});
});
})();
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