summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2017-05-07 15:40:37 -0400
committerBryce Johnson <bryce@gitlab.com>2017-05-07 15:40:37 -0400
commite7fa794c0d69b05b910fdb58810951c1f48fde97 (patch)
treef09f5a1ebdaa44180840765a8bb184bb65d6ceac
parent20d54563d7fa0db43ddb4ec27c950a773c1b80c0 (diff)
downloadgitlab-ce-zj-better-view-pipeline-schedule.tar.gz
Update function refs in interval pattern spec.zj-better-view-pipeline-schedule
-rw-r--r--spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js96
1 files changed, 32 insertions, 64 deletions
diff --git a/spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js b/spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js
index 9358050dbbd..d46af932f4b 100644
--- a/spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js
+++ b/spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js
@@ -15,16 +15,16 @@ const cronIntervalPresets = {
everyMonth: '0 4 1 * *',
};
-const gl = window.gl = window.gl || {};
+window.gl = window.gl || {};
-gl.pipelineScheduleFieldErrors = {
+window.gl.pipelineScheduleFieldErrors = {
updateFormValidityState: () => {},
};
-describe('Interval Pattern Input Component', () => {
- describe('when prop initialCronInterval is passed (edit)', () => {
- describe('when prop initialCronInterval is custom', () => {
- beforeEach(() => {
+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: {
@@ -33,29 +33,29 @@ describe('Interval Pattern Input Component', () => {
}).$mount();
});
- it('is initialized as a Vue component', () => {
+ it('is initialized as a Vue component', function () {
expect(this.intervalPatternComponent).toBeDefined();
});
- it('prop initialCronInterval is set', () => {
+ it('prop initialCronInterval is set', function () {
expect(this.intervalPatternComponent.initialCronInterval).toBe(this.initialCronInterval);
});
- it('sets showUnsetWarning to false', (done) => {
+ it('sets showUnsetWarning to false', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.showUnsetWarning).toBe(false);
done();
});
});
- it('does not render showUnsetWarning', (done) => {
+ it('does not render showUnsetWarning', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.$el.outerHTML).not.toContain('Schedule not yet set');
done();
});
});
- it('sets isEditable to true', (done) => {
+ it('sets isEditable to true', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.isEditable).toBe(true);
done();
@@ -63,8 +63,8 @@ describe('Interval Pattern Input Component', () => {
});
});
- describe('when prop initialCronInterval is preset', () => {
- beforeEach(() => {
+ describe('when prop initialCronInterval is preset', function () {
+ beforeEach(function () {
this.intervalPatternComponent = new IntervalPatternInputComponent({
propsData: {
inputNameAttribute,
@@ -73,47 +73,35 @@ describe('Interval Pattern Input Component', () => {
}).$mount();
});
- it('is initialized as a Vue component', () => {
+ it('is initialized as a Vue component', function () {
expect(this.intervalPatternComponent).toBeDefined();
});
- it('sets showUnsetWarning to false', (done) => {
+ it('sets showUnsetWarning to false', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.showUnsetWarning).toBe(false);
done();
});
});
- it('does not render showUnsetWarning', (done) => {
+ it('does not render showUnsetWarning', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.$el.outerHTML).not.toContain('Schedule not yet set');
done();
});
});
- it('sets isEditable to false', (done) => {
+ it('sets isEditable to false', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.isEditable).toBe(false);
done();
});
});
});
-
- _.each(dataDefaults, (val, key) => {
- it(`data default ${key} is properly set`, () => {
- expect(this.intervalPatternComponent[key]).toBe(val);
- });
- });
-
- _.each(cronIntervalPresets, (val, key) => {
- it(`cronIntervalPresets ${key} is properly set`, () => {
- expect(this.intervalPatternComponent.cronIntervalPresets[key]).toBe(val);
- });
- });
});
- describe('when prop initialCronInterval is not passed (new)', () => {
- beforeEach(() => {
+ describe('when prop initialCronInterval is not passed (new)', function () {
+ beforeEach(function () {
this.intervalPatternComponent = new IntervalPatternInputComponent({
propsData: {
inputNameAttribute,
@@ -121,51 +109,39 @@ describe('Interval Pattern Input Component', () => {
}).$mount();
});
- it('is initialized as a Vue component', () => {
+ it('is initialized as a Vue component', function () {
expect(this.intervalPatternComponent).toBeDefined();
});
- it('prop initialCronInterval is set', () => {
+ it('prop initialCronInterval is set', function () {
const defaultInitialCronInterval = '';
expect(this.intervalPatternComponent.initialCronInterval).toBe(defaultInitialCronInterval);
});
- it('sets showUnsetWarning to true', (done) => {
+ it('sets showUnsetWarning to true', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.showUnsetWarning).toBe(true);
done();
});
});
- it('renders showUnsetWarning to true', (done) => {
+ it('renders showUnsetWarning to true', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.$el.outerHTML).toContain('Schedule not yet set');
done();
});
});
- it('sets isEditable to true', (done) => {
+ it('sets isEditable to true', function (done) {
Vue.nextTick(() => {
expect(this.intervalPatternComponent.isEditable).toBe(true);
done();
});
});
-
- _.each(dataDefaults, (val, key) => {
- it(`data default ${key} is properly set`, () => {
- expect(this.intervalPatternComponent[key]).toBe(val);
- });
- });
-
- _.each(cronIntervalPresets, (val, key) => {
- it(`cronIntervalPresets ${key} is properly set`, () => {
- expect(this.intervalPatternComponent.cronIntervalPresets[key]).toBe(val);
- });
- });
});
- describe('User Actions', () => {
- beforeEach(() => {
+ describe('User Actions', function () {
+ beforeEach(function () {
this.initialCronInterval = '1 2 3 4 5';
this.intervalPatternComponent = new IntervalPatternInputComponent({
propsData: {
@@ -174,9 +150,7 @@ describe('Interval Pattern Input Component', () => {
}).$mount();
});
- it('cronInterval is updated when everyday preset interval is selected', (done) => {
- expect(this.intervalPatternComponent.cronInterval).toBe(this.initialCronInterval);
-
+ it('cronInterval is updated when everyday preset interval is selected', function (done) {
this.intervalPatternComponent.$el.querySelector('#every-day').click();
Vue.nextTick(() => {
@@ -186,9 +160,7 @@ describe('Interval Pattern Input Component', () => {
});
});
- it('cronInterval is updated when everyweek preset interval is selected', (done) => {
- expect(this.intervalPatternComponent.cronInterval).toBe(this.initialCronInterval);
-
+ it('cronInterval is updated when everyweek preset interval is selected', function (done) {
this.intervalPatternComponent.$el.querySelector('#every-week').click();
Vue.nextTick(() => {
@@ -199,9 +171,7 @@ describe('Interval Pattern Input Component', () => {
});
});
- it('cronInterval is updated when everymonth preset interval is selected', (done) => {
- expect(this.intervalPatternComponent.cronInterval).toBe(this.initialCronInterval);
-
+ it('cronInterval is updated when everymonth preset interval is selected', function (done) {
this.intervalPatternComponent.$el.querySelector('#every-month').click();
Vue.nextTick(() => {
@@ -211,9 +181,7 @@ describe('Interval Pattern Input Component', () => {
});
});
- it('only a space is added to cronInterval (trimmed later) when custom radio is selected', (done) => {
- expect(this.intervalPatternComponent.cronInterval).toBe(this.initialCronInterval);
-
+ 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();
@@ -225,7 +193,7 @@ describe('Interval Pattern Input Component', () => {
});
});
- it('text input is disabled when preset interval is selected', (done) => {
+ it('text input is disabled when preset interval is selected', function (done) {
this.intervalPatternComponent.$el.querySelector('#every-month').click();
Vue.nextTick(() => {
@@ -235,7 +203,7 @@ describe('Interval Pattern Input Component', () => {
});
});
- it('text input is enabled when custom is selected', (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();