diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-10-17 10:13:26 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-10-17 19:18:17 +0300 |
commit | f666026d71ebefd70219d5078b1f0c83fa01f84d (patch) | |
tree | ce43feb99c12c21dd266d25de24b1768bac1d459 /spec/javascripts/pages/projects/pipeline_schedules/shared/components | |
parent | 5a6fffcffca3dc8e4f52c90d3d18eaefd9e48aef (diff) |
Prettify all spec files
Diffstat (limited to 'spec/javascripts/pages/projects/pipeline_schedules/shared/components')
2 files changed, 46 insertions, 34 deletions
diff --git a/spec/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input_spec.js b/spec/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input_spec.js index cbd5afaede9..b20bc96f9be 100644 --- a/spec/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input_spec.js +++ b/spec/javascripts/pages/projects/pipeline_schedules/shared/components/interval_pattern_input_spec.js @@ -19,10 +19,10 @@ window.gl.pipelineScheduleFieldErrors = { updateFormValidityState: () => {}, }; -describe('Interval Pattern Input Component', function () { - describe('when prop initialCronInterval is passed (edit)', function () { - describe('when prop initialCronInterval is custom', function () { - beforeEach(function () { +describe('Interval Pattern Input Component', function() { + describe('when prop initialCronInterval is passed (edit)', function() { + describe('when prop initialCronInterval is custom', function() { + beforeEach(function() { this.initialCronInterval = '1 2 3 4 5'; this.intervalPatternComponent = new IntervalPatternInputComponent({ propsData: { @@ -31,15 +31,15 @@ describe('Interval Pattern Input Component', function () { }).$mount(); }); - it('is initialized as a Vue component', function () { + it('is initialized as a Vue component', function() { expect(this.intervalPatternComponent).toBeDefined(); }); - it('prop initialCronInterval is set', function () { + it('prop initialCronInterval is set', function() { expect(this.intervalPatternComponent.initialCronInterval).toBe(this.initialCronInterval); }); - it('sets isEditable to true', function (done) { + it('sets isEditable to true', function(done) { Vue.nextTick(() => { expect(this.intervalPatternComponent.isEditable).toBe(true); done(); @@ -47,8 +47,8 @@ describe('Interval Pattern Input Component', function () { }); }); - describe('when prop initialCronInterval is preset', function () { - beforeEach(function () { + describe('when prop initialCronInterval is preset', function() { + beforeEach(function() { this.intervalPatternComponent = new IntervalPatternInputComponent({ propsData: { inputNameAttribute, @@ -57,11 +57,11 @@ describe('Interval Pattern Input Component', function () { }).$mount(); }); - it('is initialized as a Vue component', function () { + it('is initialized as a Vue component', function() { expect(this.intervalPatternComponent).toBeDefined(); }); - it('sets isEditable to false', function (done) { + it('sets isEditable to false', function(done) { Vue.nextTick(() => { expect(this.intervalPatternComponent.isEditable).toBe(false); done(); @@ -70,8 +70,8 @@ describe('Interval Pattern Input Component', function () { }); }); - describe('when prop initialCronInterval is not passed (new)', function () { - beforeEach(function () { + describe('when prop initialCronInterval is not passed (new)', function() { + beforeEach(function() { this.intervalPatternComponent = new IntervalPatternInputComponent({ propsData: { inputNameAttribute, @@ -79,17 +79,17 @@ describe('Interval Pattern Input Component', function () { }).$mount(); }); - it('is initialized as a Vue component', function () { + it('is initialized as a Vue component', function() { expect(this.intervalPatternComponent).toBeDefined(); }); - it('prop initialCronInterval is set', function () { + it('prop initialCronInterval is set', function() { const defaultInitialCronInterval = ''; expect(this.intervalPatternComponent.initialCronInterval).toBe(defaultInitialCronInterval); }); - it('sets isEditable to true', function (done) { + it('sets isEditable to true', function(done) { Vue.nextTick(() => { expect(this.intervalPatternComponent.isEditable).toBe(true); done(); @@ -97,8 +97,8 @@ describe('Interval Pattern Input Component', function () { }); }); - describe('User Actions', function () { - beforeEach(function () { + describe('User Actions', function() { + beforeEach(function() { // For an unknown reason, some browsers do not propagate click events // on radio buttons in a way Vue can register. So, we have to mount // to a fixture. @@ -112,38 +112,44 @@ describe('Interval Pattern Input Component', function () { }).$mount('#my-mount'); }); - it('cronInterval is updated when everyday preset interval is selected', function (done) { + it('cronInterval is updated when everyday preset interval is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-day').click(); Vue.nextTick(() => { expect(this.intervalPatternComponent.cronInterval).toBe(cronIntervalPresets.everyDay); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe(cronIntervalPresets.everyDay); + expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe( + cronIntervalPresets.everyDay, + ); done(); }); }); - it('cronInterval is updated when everyweek preset interval is selected', function (done) { + it('cronInterval is updated when everyweek preset interval is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-week').click(); Vue.nextTick(() => { expect(this.intervalPatternComponent.cronInterval).toBe(cronIntervalPresets.everyWeek); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe(cronIntervalPresets.everyWeek); + expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe( + cronIntervalPresets.everyWeek, + ); done(); }); }); - it('cronInterval is updated when everymonth preset interval is selected', function (done) { + it('cronInterval is updated when everymonth preset interval is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-month').click(); Vue.nextTick(() => { expect(this.intervalPatternComponent.cronInterval).toBe(cronIntervalPresets.everyMonth); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe(cronIntervalPresets.everyMonth); + expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe( + cronIntervalPresets.everyMonth, + ); done(); }); }); - it('only a space is added to cronInterval (trimmed later) when custom radio is selected', function (done) { + it('only a space is added to cronInterval (trimmed later) when custom radio is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-month').click(); this.intervalPatternComponent.$el.querySelector('#custom').click(); @@ -151,28 +157,34 @@ describe('Interval Pattern Input Component', function () { const intervalWithSpaceAppended = `${cronIntervalPresets.everyMonth} `; expect(this.intervalPatternComponent.cronInterval).toBe(intervalWithSpaceAppended); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe(intervalWithSpaceAppended); + expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').value).toBe( + intervalWithSpaceAppended, + ); done(); }); }); - it('text input is disabled when preset interval is selected', function (done) { + it('text input is disabled when preset interval is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-month').click(); Vue.nextTick(() => { expect(this.intervalPatternComponent.isEditable).toBe(false); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').disabled).toBe(true); + expect( + this.intervalPatternComponent.$el.querySelector('.cron-interval-input').disabled, + ).toBe(true); done(); }); }); - it('text input is enabled when custom is selected', function (done) { + it('text input is enabled when custom is selected', function(done) { this.intervalPatternComponent.$el.querySelector('#every-month').click(); this.intervalPatternComponent.$el.querySelector('#custom').click(); Vue.nextTick(() => { expect(this.intervalPatternComponent.isEditable).toBe(true); - expect(this.intervalPatternComponent.$el.querySelector('.cron-interval-input').disabled).toBe(false); + expect( + this.intervalPatternComponent.$el.querySelector('.cron-interval-input').disabled, + ).toBe(false); done(); }); }); diff --git a/spec/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedule_callout_spec.js b/spec/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedule_callout_spec.js index fb7d2763b49..ea809e1f170 100644 --- a/spec/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedule_callout_spec.js +++ b/spec/javascripts/pages/projects/pipeline_schedules/shared/components/pipeline_schedule_callout_spec.js @@ -6,7 +6,7 @@ const PipelineSchedulesCalloutComponent = Vue.extend(PipelineSchedulesCallout); const cookieKey = 'pipeline_schedules_callout_dismissed'; const docsUrl = 'help/ci/scheduled_pipelines'; -describe('Pipeline Schedule Callout', function () { +describe('Pipeline Schedule Callout', function() { beforeEach(() => { setFixtures(` <div id='pipeline-schedules-callout' data-docs-url=${docsUrl}></div> @@ -76,7 +76,7 @@ describe('Pipeline Schedule Callout', function () { expect(this.calloutComponent.$el.outerHTML).toContain(docsUrl); }); - it('updates calloutDismissed when close button is clicked', (done) => { + it('updates calloutDismissed when close button is clicked', done => { this.calloutComponent.$el.querySelector('#dismiss-callout-btn').click(); Vue.nextTick(() => { @@ -85,7 +85,7 @@ describe('Pipeline Schedule Callout', function () { }); }); - it('#dismissCallout updates calloutDismissed', (done) => { + it('#dismissCallout updates calloutDismissed', done => { this.calloutComponent.dismissCallout(); Vue.nextTick(() => { @@ -94,7 +94,7 @@ describe('Pipeline Schedule Callout', function () { }); }); - it('is hidden when close button is clicked', (done) => { + it('is hidden when close button is clicked', done => { this.calloutComponent.$el.querySelector('#dismiss-callout-btn').click(); Vue.nextTick(() => { |