Skip to content

Commit db85dbb

Browse files
committed
Merge branch '51712-new-line-between-declarations' into 'master'
1. enable jasmine/new-line-between-declarations See merge request gitlab-org/gitlab-ce!22230
2 parents 80a1bb1 + 2a76e04 commit db85dbb

15 files changed

+115
-1
lines changed

spec/javascripts/.eslintrc.yml

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ rules:
3737
- 'fixtures/blob'
3838
# Temporarily disabled to facilitate an upgrade to eslint-plugin-jasmine
3939
jasmine/new-line-before-expect: off
40-
jasmine/new-line-between-declarations: off
4140
jasmine/no-promise-without-done-fail: off
4241
jasmine/prefer-jasmine-matcher: off
4342
jasmine/prefer-toHaveBeenCalledWith: off

spec/javascripts/awards_handler_spec.js

+16
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import '~/lib/utils/common_utils';
5555
});
5656
};
5757
});
58+
5859
afterEach(function() {
5960
// restore original url root value
6061
gon.relative_url_root = urlRoot;
@@ -64,6 +65,7 @@ import '~/lib/utils/common_utils';
6465

6566
awardsHandler.destroy();
6667
});
68+
6769
describe('::showEmojiMenu', function() {
6870
it('should show emoji menu when Add emoji button clicked', function(done) {
6971
$('.js-add-award')
@@ -78,13 +80,15 @@ import '~/lib/utils/common_utils';
7880
return expect($('.js-awards-block.current').length).toBe(1);
7981
});
8082
});
83+
8184
it('should also show emoji menu for the smiley icon in notes', function(done) {
8285
$('.js-add-award.note-action-button').click();
8386
return lazyAssert(done, function() {
8487
var $emojiMenu = $('.emoji-menu');
8588
return expect($emojiMenu.length).toBe(1);
8689
});
8790
});
91+
8892
it('should remove emoji menu when body is clicked', function(done) {
8993
$('.js-add-award')
9094
.eq(0)
@@ -98,6 +102,7 @@ import '~/lib/utils/common_utils';
98102
return expect($('.js-awards-block.current').length).toBe(0);
99103
});
100104
});
105+
101106
it('should not remove emoji menu when search is clicked', function(done) {
102107
$('.js-add-award')
103108
.eq(0)
@@ -123,6 +128,7 @@ import '~/lib/utils/common_utils';
123128
expect($emojiButton.next('.js-counter').text()).toBe('1');
124129
return expect($votesBlock.hasClass('hidden')).toBe(false);
125130
});
131+
126132
it('should remove the emoji when we click again', function() {
127133
var $emojiButton, $votesBlock;
128134
$votesBlock = $('.js-awards-block').eq(0);
@@ -142,6 +148,7 @@ import '~/lib/utils/common_utils';
142148
return expect($emojiButton.next('.js-counter').text()).toBe('4');
143149
});
144150
});
151+
145152
describe('::userAuthored', function() {
146153
it('should update tooltip to user authored title', function() {
147154
var $thumbsUpEmoji, $votesBlock;
@@ -153,6 +160,7 @@ import '~/lib/utils/common_utils';
153160
'You cannot vote on your own issue, MR and note',
154161
);
155162
});
163+
156164
it('should restore tooltip back to initial vote list', function() {
157165
var $thumbsUpEmoji, $votesBlock;
158166
jasmine.clock().install();
@@ -165,13 +173,15 @@ import '~/lib/utils/common_utils';
165173
return expect($thumbsUpEmoji.data('originalTitle')).toBe('sam');
166174
});
167175
});
176+
168177
describe('::getAwardUrl', function() {
169178
return it('returns the url for request', function() {
170179
return expect(awardsHandler.getAwardUrl()).toBe(
171180
'http://test.host/snippets/1/toggle_award_emoji',
172181
);
173182
});
174183
});
184+
175185
describe('::addAward and ::checkMutuality', function() {
176186
return it('should handle :+1: and :-1: mutuality', function() {
177187
var $thumbsDownEmoji, $thumbsUpEmoji, $votesBlock, awardUrl;
@@ -189,6 +199,7 @@ import '~/lib/utils/common_utils';
189199
return expect($thumbsDownEmoji.hasClass('active')).toBe(true);
190200
});
191201
});
202+
192203
describe('::removeEmoji', function() {
193204
return it('should remove emoji', function() {
194205
var $votesBlock, awardUrl;
@@ -200,6 +211,7 @@ import '~/lib/utils/common_utils';
200211
return expect($votesBlock.find('[data-name=fire]').length).toBe(0);
201212
});
202213
});
214+
203215
describe('::addYouToUserList', function() {
204216
it('should prepend "You" to the award tooltip', function() {
205217
var $thumbsUpEmoji, $votesBlock, awardUrl;
@@ -222,6 +234,7 @@ import '~/lib/utils/common_utils';
222234
return expect($thumbsUpEmoji.data('originalTitle')).toBe('You and sam');
223235
});
224236
});
237+
225238
describe('::removeYouToUserList', function() {
226239
it('removes "You" from the front of the tooltip', function() {
227240
var $thumbsUpEmoji, $votesBlock, awardUrl;
@@ -246,6 +259,7 @@ import '~/lib/utils/common_utils';
246259
return expect($thumbsUpEmoji.data('originalTitle')).toBe('sam');
247260
});
248261
});
262+
249263
describe('::searchEmojis', () => {
250264
it('should filter the emoji', function(done) {
251265
return openAndWaitForEmojiMenu()
@@ -263,6 +277,7 @@ import '~/lib/utils/common_utils';
263277
done.fail(`Failed to open and build emoji menu: ${err.message}`);
264278
});
265279
});
280+
266281
it('should clear the search when searching for nothing', function(done) {
267282
return openAndWaitForEmojiMenu()
268283
.then(() => {
@@ -305,6 +320,7 @@ import '~/lib/utils/common_utils';
305320
done.fail(`Failed to open and build emoji menu: ${err.message}`);
306321
});
307322
});
323+
308324
it('should remove already selected emoji', function(done) {
309325
return openEmojiMenuAndAddEmoji()
310326
.then(() => {

spec/javascripts/behaviors/quick_submit_spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ describe('Quick Submit behavior', function () {
5858

5959
expect(submitButton).toBeDisabled();
6060
});
61+
6162
it('disables button of type submit', () => {
6263
const submitButton = $('.js-quick-submit input[type=submit]');
6364
this.textarea.trigger(keydownEvent());
6465

6566
expect(submitButton).toBeDisabled();
6667
});
68+
6769
it('only clicks one submit', () => {
6870
const existingSubmit = $('.js-quick-submit input[type=submit]');
6971
// Add an extra submit button

spec/javascripts/bootstrap_jquery_spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '~/commons/bootstrap';
99
beforeEach(function() {
1010
return setFixtures('<input type="text" />');
1111
});
12+
1213
it('adds the disabled attribute', function() {
1314
var $input;
1415
$input = $('input').first();
@@ -26,6 +27,7 @@ import '~/commons/bootstrap';
2627
beforeEach(function() {
2728
return setFixtures('<input type="text" disabled="disabled" class="disabled" />');
2829
});
30+
2931
it('removes the disabled attribute', function() {
3032
var $input;
3133
$input = $('input').first();

spec/javascripts/emoji_spec.js

+38
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ describe('gl_emoji', () => {
140140
},
141141
);
142142
});
143+
143144
it('bomb emoji with sprite fallback', () => {
144145
const emojiKey = 'bomb';
145146
const markup = glEmojiTag(emojiFixtureMap[emojiKey].name, {
@@ -195,24 +196,31 @@ describe('gl_emoji', () => {
195196
it('should gracefully handle empty string', () => {
196197
expect(isFlagEmoji('')).toBeFalsy();
197198
});
199+
198200
it('should detect flag_ac', () => {
199201
expect(isFlagEmoji('🇦🇨')).toBeTruthy();
200202
});
203+
201204
it('should detect flag_us', () => {
202205
expect(isFlagEmoji('🇺🇸')).toBeTruthy();
203206
});
207+
204208
it('should detect flag_zw', () => {
205209
expect(isFlagEmoji('🇿🇼')).toBeTruthy();
206210
});
211+
207212
it('should not detect flags', () => {
208213
expect(isFlagEmoji('🎏')).toBeFalsy();
209214
});
215+
210216
it('should not detect triangular_flag_on_post', () => {
211217
expect(isFlagEmoji('🚩')).toBeFalsy();
212218
});
219+
213220
it('should not detect single letter', () => {
214221
expect(isFlagEmoji('🇦')).toBeFalsy();
215222
});
223+
216224
it('should not detect >2 letters', () => {
217225
expect(isFlagEmoji('🇦🇧🇨')).toBeFalsy();
218226
});
@@ -222,15 +230,19 @@ describe('gl_emoji', () => {
222230
it('should gracefully handle empty string', () => {
223231
expect(isRainbowFlagEmoji('')).toBeFalsy();
224232
});
233+
225234
it('should detect rainbow_flag', () => {
226235
expect(isRainbowFlagEmoji('🏳🌈')).toBeTruthy();
227236
});
237+
228238
it('should not detect flag_white on its\' own', () => {
229239
expect(isRainbowFlagEmoji('🏳')).toBeFalsy();
230240
});
241+
231242
it('should not detect rainbow on its\' own', () => {
232243
expect(isRainbowFlagEmoji('🌈')).toBeFalsy();
233244
});
245+
234246
it('should not detect flag_white with something else', () => {
235247
expect(isRainbowFlagEmoji('🏳🔵')).toBeFalsy();
236248
});
@@ -240,15 +252,19 @@ describe('gl_emoji', () => {
240252
it('should gracefully handle empty string', () => {
241253
expect(isKeycapEmoji('')).toBeFalsy();
242254
});
255+
243256
it('should detect one(keycap)', () => {
244257
expect(isKeycapEmoji('1️⃣')).toBeTruthy();
245258
});
259+
246260
it('should detect nine(keycap)', () => {
247261
expect(isKeycapEmoji('9️⃣')).toBeTruthy();
248262
});
263+
249264
it('should not detect ten(keycap)', () => {
250265
expect(isKeycapEmoji('🔟')).toBeFalsy();
251266
});
267+
252268
it('should not detect hash(keycap)', () => {
253269
expect(isKeycapEmoji('#⃣')).toBeFalsy();
254270
});
@@ -258,24 +274,31 @@ describe('gl_emoji', () => {
258274
it('should gracefully handle empty string', () => {
259275
expect(isSkinToneComboEmoji('')).toBeFalsy();
260276
});
277+
261278
it('should detect hand_splayed_tone5', () => {
262279
expect(isSkinToneComboEmoji('🖐🏿')).toBeTruthy();
263280
});
281+
264282
it('should not detect hand_splayed', () => {
265283
expect(isSkinToneComboEmoji('🖐')).toBeFalsy();
266284
});
285+
267286
it('should detect lifter_tone1', () => {
268287
expect(isSkinToneComboEmoji('🏋🏻')).toBeTruthy();
269288
});
289+
270290
it('should not detect lifter', () => {
271291
expect(isSkinToneComboEmoji('🏋')).toBeFalsy();
272292
});
293+
273294
it('should detect rowboat_tone4', () => {
274295
expect(isSkinToneComboEmoji('🚣🏾')).toBeTruthy();
275296
});
297+
276298
it('should not detect rowboat', () => {
277299
expect(isSkinToneComboEmoji('🚣')).toBeFalsy();
278300
});
301+
279302
it('should not detect individual tone emoji', () => {
280303
expect(isSkinToneComboEmoji('🏻')).toBeFalsy();
281304
});
@@ -285,9 +308,11 @@ describe('gl_emoji', () => {
285308
it('should gracefully handle empty string', () => {
286309
expect(isHorceRacingSkinToneComboEmoji('')).toBeFalsy();
287310
});
311+
288312
it('should detect horse_racing_tone2', () => {
289313
expect(isHorceRacingSkinToneComboEmoji('🏇🏼')).toBeTruthy();
290314
});
315+
291316
it('should not detect horse_racing', () => {
292317
expect(isHorceRacingSkinToneComboEmoji('🏇')).toBeFalsy();
293318
});
@@ -297,36 +322,47 @@ describe('gl_emoji', () => {
297322
it('should gracefully handle empty string', () => {
298323
expect(isPersonZwjEmoji('')).toBeFalsy();
299324
});
325+
300326
it('should detect couple_mm', () => {
301327
expect(isPersonZwjEmoji('👨‍❤️‍👨')).toBeTruthy();
302328
});
329+
303330
it('should not detect couple_with_heart', () => {
304331
expect(isPersonZwjEmoji('💑')).toBeFalsy();
305332
});
333+
306334
it('should not detect couplekiss', () => {
307335
expect(isPersonZwjEmoji('💏')).toBeFalsy();
308336
});
337+
309338
it('should detect family_mmb', () => {
310339
expect(isPersonZwjEmoji('👨‍👨‍👦')).toBeTruthy();
311340
});
341+
312342
it('should detect family_mwgb', () => {
313343
expect(isPersonZwjEmoji('👨‍👩‍👧‍👦')).toBeTruthy();
314344
});
345+
315346
it('should not detect family', () => {
316347
expect(isPersonZwjEmoji('👪')).toBeFalsy();
317348
});
349+
318350
it('should detect kiss_ww', () => {
319351
expect(isPersonZwjEmoji('👩‍❤️‍💋‍👩')).toBeTruthy();
320352
});
353+
321354
it('should not detect girl', () => {
322355
expect(isPersonZwjEmoji('👧')).toBeFalsy();
323356
});
357+
324358
it('should not detect girl_tone5', () => {
325359
expect(isPersonZwjEmoji('👧🏿')).toBeFalsy();
326360
});
361+
327362
it('should not detect man', () => {
328363
expect(isPersonZwjEmoji('👨')).toBeFalsy();
329364
});
365+
330366
it('should not detect woman', () => {
331367
expect(isPersonZwjEmoji('👩')).toBeFalsy();
332368
});
@@ -341,6 +377,7 @@ describe('gl_emoji', () => {
341377
);
342378
expect(isSupported).toBeTruthy();
343379
});
380+
344381
it('should gracefully handle empty string without unicode support', () => {
345382
const isSupported = isEmojiUnicodeSupported(
346383
{},
@@ -349,6 +386,7 @@ describe('gl_emoji', () => {
349386
);
350387
expect(isSupported).toBeFalsy();
351388
});
389+
352390
it('bomb(6.0) with 6.0 support', () => {
353391
const emojiKey = 'bomb';
354392
const unicodeSupportMap = Object.assign({}, emptySupportMap, {

spec/javascripts/graphs/stat_graph_contributors_util_spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,12 @@ describe("ContributorsStatGraphUtil", function () {
205205
it("returns true if date_range is null", function () {
206206
expect(ContributorsStatGraphUtil.in_range(date, null)).toEqual(true);
207207
});
208+
208209
it("returns true if date is in range", function () {
209210
var date_range = [new Date("2013-01-01"), new Date("2013-12-12")];
210211
expect(ContributorsStatGraphUtil.in_range(date, date_range)).toEqual(true);
211212
});
213+
212214
it("returns false if date is not in range", function () {
213215
var date_range = [new Date("1999-12-01"), new Date("2000-12-01")];
214216
expect(ContributorsStatGraphUtil.in_range(date, date_range)).toEqual(false);

spec/javascripts/jobs/components/job_log_controllers_spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('Job log controllers', () => {
2525
beforeEach(() => {
2626
vm = mountComponent(Component, props);
2727
});
28+
2829
it('renders size information', () => {
2930
expect(vm.$el.querySelector('.js-truncated-info').textContent).toContain('499.95 KiB');
3031
});

spec/javascripts/lib/utils/common_utils_spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('common_utils', () => {
99
it('returns an anchor tag with url', () => {
1010
expect(commonUtils.parseUrl('/some/absolute/url').pathname).toContain('some/absolute/url');
1111
});
12+
1213
it('url is escaped', () => {
1314
// IE11 will return a relative pathname while other browsers will return a full pathname.
1415
// parseUrl uses an anchor element for parsing an url. With relative urls, the anchor

0 commit comments

Comments
 (0)