Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
31a5ed97
Commit
31a5ed97
authored
Nov 23, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer arrow functions in build_spec.js.es6
parent
d9fe5c25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
spec/javascripts/build_spec.js.es6
spec/javascripts/build_spec.js.es6
+14
-14
No files found.
spec/javascripts/build_spec.js.es6
View file @
31a5ed97
...
@@ -20,13 +20,13 @@ describe('Build', () => {
...
@@ -20,13 +20,13 @@ describe('Build', () => {
fixture.preload('builds/build-with-artifacts.html.raw');
fixture.preload('builds/build-with-artifacts.html.raw');
beforeEach(
function ()
{
beforeEach(
() =>
{
fixture.load('builds/build-with-artifacts.html.raw');
fixture.load('builds/build-with-artifacts.html.raw');
spyOn($, 'ajax');
spyOn($, 'ajax');
});
});
describe('constructor', () => {
describe('constructor', () => {
beforeEach(
function ()
{
beforeEach(
() =>
{
jasmine.clock().install();
jasmine.clock().install();
});
});
...
@@ -34,7 +34,7 @@ describe('Build', () => {
...
@@ -34,7 +34,7 @@ describe('Build', () => {
jasmine.clock().uninstall();
jasmine.clock().uninstall();
});
});
describe('setup',
function ()
{
describe('setup',
() =>
{
beforeEach(function () {
beforeEach(function () {
this.build = new Build();
this.build = new Build();
});
});
...
@@ -47,17 +47,17 @@ describe('Build', () => {
...
@@ -47,17 +47,17 @@ describe('Build', () => {
expect(this.build.state).toBe(INITIAL_BUILD_TRACE_STATE);
expect(this.build.state).toBe(INITIAL_BUILD_TRACE_STATE);
});
});
it('only shows the jobs matching the current stage',
function ()
{
it('only shows the jobs matching the current stage',
() =>
{
expect($('.build-job[data-stage="build"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="build"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="test"]').is(':visible')).toBe(true);
expect($('.build-job[data-stage="test"]').is(':visible')).toBe(true);
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
});
});
it('selects the current stage in the build dropdown menu',
function ()
{
it('selects the current stage in the build dropdown menu',
() =>
{
expect($('.stage-selection').text()).toBe('test');
expect($('.stage-selection').text()).toBe('test');
});
});
it('updates the jobs when the build dropdown changes',
function ()
{
it('updates the jobs when the build dropdown changes',
() =>
{
$('.stage-item:contains("build")').click();
$('.stage-item:contains("build")').click();
expect($('.stage-selection').text()).toBe('build');
expect($('.stage-selection').text()).toBe('build');
...
@@ -66,18 +66,18 @@ describe('Build', () => {
...
@@ -66,18 +66,18 @@ describe('Build', () => {
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
expect($('.build-job[data-stage="deploy"]').is(':visible')).toBe(false);
});
});
it('displays the remove date correctly',
function ()
{
it('displays the remove date correctly',
() =>
{
const removeDateElement = document.querySelector('.js-artifacts-remove');
const removeDateElement = document.querySelector('.js-artifacts-remove');
expect(removeDateElement.innerText.trim()).toBe('1 year');
expect(removeDateElement.innerText.trim()).toBe('1 year');
});
});
});
});
describe('initial build trace',
function ()
{
describe('initial build trace',
() =>
{
beforeEach(
function ()
{
beforeEach(
() =>
{
new Build();
new Build();
});
});
it('displays the initial build trace',
function ()
{
it('displays the initial build trace',
() =>
{
expect($.ajax.calls.count()).toBe(1);
expect($.ajax.calls.count()).toBe(1);
const [{ url, dataType, success, context }] = $.ajax.calls.argsFor(0);
const [{ url, dataType, success, context }] = $.ajax.calls.argsFor(0);
expect(url).toBe(`${BUILD_URL}.json`);
expect(url).toBe(`${BUILD_URL}.json`);
...
@@ -89,7 +89,7 @@ describe('Build', () => {
...
@@ -89,7 +89,7 @@ describe('Build', () => {
expect($('#build-trace .js-build-output').text()).toMatch(/Example/);
expect($('#build-trace .js-build-output').text()).toMatch(/Example/);
});
});
it('removes the spinner',
function ()
{
it('removes the spinner',
() =>
{
const [{ success, context }] = $.ajax.calls.argsFor(0);
const [{ success, context }] = $.ajax.calls.argsFor(0);
success.call(context, { trace_html: '<span>Example</span>', status: 'success' });
success.call(context, { trace_html: '<span>Example</span>', status: 'success' });
...
@@ -97,7 +97,7 @@ describe('Build', () => {
...
@@ -97,7 +97,7 @@ describe('Build', () => {
});
});
});
});
describe('running build',
function ()
{
describe('running build',
() =>
{
beforeEach(function () {
beforeEach(function () {
$('.js-build-options').data('buildStatus', 'running');
$('.js-build-options').data('buildStatus', 'running');
this.build = new Build();
this.build = new Build();
...
@@ -144,7 +144,7 @@ describe('Build', () => {
...
@@ -144,7 +144,7 @@ describe('Build', () => {
expect(this.build.state).toBe('finalstate');
expect(this.build.state).toBe('finalstate');
});
});
it('replaces the entire build trace',
function ()
{
it('replaces the entire build trace',
() =>
{
jasmine.clock().tick(4001);
jasmine.clock().tick(4001);
let [{ success, context }] = $.ajax.calls.argsFor(1);
let [{ success, context }] = $.ajax.calls.argsFor(1);
success.call(context, {
success.call(context, {
...
@@ -167,7 +167,7 @@ describe('Build', () => {
...
@@ -167,7 +167,7 @@ describe('Build', () => {
expect($('#build-trace .js-build-output').text()).toMatch(/Different/);
expect($('#build-trace .js-build-output').text()).toMatch(/Different/);
});
});
it('reloads the page when the build is done',
function ()
{
it('reloads the page when the build is done',
() =>
{
spyOn(Turbolinks, 'visit');
spyOn(Turbolinks, 'visit');
jasmine.clock().tick(4001);
jasmine.clock().tick(4001);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment