Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit cb00f62

Browse files
author
Nick Litwin
committed
Too many semicolons
1 parent 00074e0 commit cb00f62

File tree

124 files changed

+4426
-4521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+4426
-4521
lines changed

.eslintrc.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@
66
"quotes": [2, "single"],
77
"semi": [2, "never"]
88
},
9+
"globals": {
10+
"expect": true,
11+
"bard": true,
12+
"$rootScope": true,
13+
"$controller": true,
14+
"$compile": true,
15+
"$timeout": true,
16+
"$httpBackend": true,
17+
"$state": true,
18+
"sinon": true,
19+
"$q": true,
20+
"$": true
21+
},
922
"env": {
1023
"es6": true,
1124
"browser": true,
12-
"node": true
25+
"node": true,
26+
"mocha": true
1327
},
1428
"extends": "eslint:recommended",
1529
"ecmaFeatures": {

app/account/login/login.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* jshint -W117, -W030 */
21
describe('Login Controller', function() {
32
var controller
43
var scope

app/account/register/register.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Register Controller', function() {
1616
beforeEach(function() {
1717
var helperService = {
1818
getCountyObjFromIP: function() {
19-
return $q.when({name: "United States", alpha2: "US", alpha3: "USA", code: "840"})
19+
return $q.when({name: 'United States', alpha2: 'US', alpha3: 'USA', code: '840'})
2020
}
2121
}
2222

app/directives/account/toggle-password-with-tips/toggle-password-with-tips.spec.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import angular from 'angular'
22
import jQuery from 'jquery'
3-
const mockData = require('../../../../tests/test-helpers/mock-data')
43

5-
/* jshint -W117, -W030 */
64
describe('Toggle Password With Tips Directive', function() {
75
var scope
86
var element
9-
// var challenge = mockData.getMockChallengeWithUserDetails()
10-
// var spotlightChallenge = mockData.getMockSpotlightChallenges()[0]
117

128
beforeEach(function() {
139
bard.appModule('topcoder')
@@ -19,12 +15,12 @@ describe('Toggle Password With Tips Directive', function() {
1915
bard.verifyNoOutstandingHttpRequests()
2016

2117
describe('Toggle Password Directive', function() {
22-
var togglePassword, controller, formController, passwordFormFieldSpy
18+
var formController, passwordFormFieldSpy
2319

2420
beforeEach(function() {
2521
var form = angular.element('<form><toggle-password-with-tips /></form>)')
2622
element = form.find('toggle-password-with-tips')
27-
var formElement = $compile(form)(scope)
23+
$compile(form)(scope)
2824
scope.$digest()
2925

3026
// controller = element.controller('togglePassword')
@@ -96,7 +92,7 @@ describe('Toggle Password With Tips Directive', function() {
9692
expect(element.hasClass('focus')).to.be.true
9793
// now blurs from it
9894

99-
var e = jQuery.Event("blur")
95+
var e = jQuery.Event('blur')
10096
e.relatedTarget = {
10197
getAttribute: function(name) {
10298
if (name === 'type') return 'checkbox'
@@ -140,15 +136,15 @@ describe('Toggle Password With Tips Directive', function() {
140136

141137
it('should trigger keyup handler with enter/return key ', function() {
142138
var mockBlur = sinon.spy(element.find('input')[0], 'blur')
143-
var e = jQuery.Event("keyup")
139+
var e = jQuery.Event('keyup')
144140
e.keyCode = 13
145141
element.trigger(e)
146142
expect(mockBlur).to.be.calledOnce
147143
})
148144

149145
it('should NOT trigger keyup handler with non enter/return key ', function() {
150146
var mockBlur = sinon.spy(element.find('input')[0], 'blur')
151-
var e = jQuery.Event("keyup")
147+
var e = jQuery.Event('keyup')
152148
e.keyCode = 14
153149
element.trigger(e)
154150
expect(mockBlur).not.to.be.called
Lines changed: 89 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,152 @@
1-
/* jshint -W117, -W030 */
1+
import angular from 'angular'
2+
import jQuery from 'jquery'
3+
24
describe('Toggle Password Directive', function() {
3-
var scope;
4-
var element;
5+
var scope
6+
var element
57

68
beforeEach(function() {
7-
bard.appModule('topcoder');
8-
bard.inject(this, '$compile', '$rootScope');
9-
scope = $rootScope.$new();
10-
scope.vm = {};
11-
});
9+
bard.appModule('topcoder')
10+
bard.inject(this, '$compile', '$rootScope')
11+
scope = $rootScope.$new()
12+
scope.vm = {}
13+
})
1214

13-
bard.verifyNoOutstandingHttpRequests();
15+
bard.verifyNoOutstandingHttpRequests()
1416

1517
describe('Toggle Password Directive', function() {
16-
var togglePassword, controller, formController, passwordFormFieldSpy;
18+
var formController, passwordFormFieldSpy
1719

1820
beforeEach(function() {
19-
var form = angular.element('<form><toggle-password /></form>)');
20-
element = form.find('toggle-password');
21-
var formElement = $compile(form)(scope);
22-
scope.$digest();
21+
var form = angular.element('<form><toggle-password /></form>)')
22+
element = form.find('toggle-password')
23+
$compile(form)(scope)
24+
scope.$digest()
2325

24-
// controller = element.controller('togglePassword');
25-
formController = form.controller('form');
26-
passwordFormFieldSpy = sinon.spy(formController.currentPassword, '$setPristine');
27-
});
26+
formController = form.controller('form')
27+
passwordFormFieldSpy = sinon.spy(formController.currentPassword, '$setPristine')
28+
})
2829

2930
afterEach(function() {
3031
// do nohting
31-
});
32+
})
3233

3334
it('should have password default placeholder', function() {
34-
expect(scope.currentPasswordDefaultPlaceholder).to.exist.to.equal('Password');
35-
expect(scope.currentPasswordPlaceholder).to.exist.to.equal('Password');
36-
});
35+
expect(scope.currentPasswordDefaultPlaceholder).to.exist.to.equal('Password')
36+
expect(scope.currentPasswordPlaceholder).to.exist.to.equal('Password')
37+
})
3738

3839
it('should not have focus class', function() {
39-
expect(element.hasClass('focus')).to.be.false;
40-
});
40+
expect(element.hasClass('focus')).to.be.false
41+
})
4142

4243
it('should trigger click handler ', function() {
43-
var mockFocus = sinon.spy(element.find('input')[0], 'focus');
44-
element.trigger('click');
45-
expect(mockFocus).to.be.calledOnce;
46-
});
44+
var mockFocus = sinon.spy(element.find('input')[0], 'focus')
45+
element.trigger('click')
46+
expect(mockFocus).to.be.calledOnce
47+
})
4748

4849
it('should trigger focus handler ', function() {
49-
var pwsIntputElement = angular.element(element.find('input')[0]);
50-
pwsIntputElement.triggerHandler('focus');
51-
expect(element.hasClass('focus')).to.be.true;
52-
});
50+
var pwsIntputElement = angular.element(element.find('input')[0])
51+
pwsIntputElement.triggerHandler('focus')
52+
expect(element.hasClass('focus')).to.be.true
53+
})
5354

5455
it('should trigger blur handler with form field pristine ', function() {
55-
var pwsIntputElement = angular.element(element.find('input')[0]);
56+
var pwsIntputElement = angular.element(element.find('input')[0])
5657
// focus it first
57-
pwsIntputElement.triggerHandler('focus');
58+
pwsIntputElement.triggerHandler('focus')
5859
// verifies if focus class is added
59-
expect(element.hasClass('focus')).to.be.true;
60+
expect(element.hasClass('focus')).to.be.true
6061
// now blurs from it
61-
pwsIntputElement.triggerHandler('blur');
62+
pwsIntputElement.triggerHandler('blur')
6263
// focus class should not be there
63-
expect(element.hasClass('focus')).to.be.false;
64+
expect(element.hasClass('focus')).to.be.false
6465
// password field's setPristine method should be called once because currentPassword is empty
65-
expect(passwordFormFieldSpy).to.be.calledOnce;
66-
});
66+
expect(passwordFormFieldSpy).to.be.calledOnce
67+
})
6768

6869
it('should trigger blur handler without form field pristine ', function() {
69-
scope.vm.currentPassword = 'some-password';
70-
scope.$digest();
71-
var pwsIntputElement = angular.element(element.find('input')[0]);
70+
scope.vm.currentPassword = 'some-password'
71+
scope.$digest()
72+
var pwsIntputElement = angular.element(element.find('input')[0])
7273
// focus it first
73-
pwsIntputElement.triggerHandler('focus');
74+
pwsIntputElement.triggerHandler('focus')
7475
// verifies if focus class is added
75-
expect(element.hasClass('focus')).to.be.true;
76+
expect(element.hasClass('focus')).to.be.true
7677
// now blurs from it
77-
pwsIntputElement.triggerHandler('blur');
78+
pwsIntputElement.triggerHandler('blur')
7879
// focus class should not be there
79-
expect(element.hasClass('focus')).to.be.false;
80+
expect(element.hasClass('focus')).to.be.false
8081
// password field's setPristine method should not be called because currentPassword is non-empty
81-
expect(passwordFormFieldSpy).not.to.be.called;
82-
});
82+
expect(passwordFormFieldSpy).not.to.be.called
83+
})
8384

8485
it('should keep focus on password field on blurring to checkbox ', function() {
8586

86-
var pwsIntputElement = angular.element(element.find('input')[0]);
87+
var pwsIntputElement = angular.element(element.find('input')[0])
8788
// focus it first
88-
pwsIntputElement.triggerHandler('focus');
89+
pwsIntputElement.triggerHandler('focus')
8990
// verifies if focus class is added
90-
expect(element.hasClass('focus')).to.be.true;
91+
expect(element.hasClass('focus')).to.be.true
9192
// now blurs from it
9293

93-
var e = jQuery.Event("blur");
94+
var e = jQuery.Event('blur')
9495
e.relatedTarget = {
9596
getAttribute: function(name) {
96-
if (name === 'type') return 'checkbox';
97-
if (name === 'id') return 'currentPasswordCheckbox';
97+
if (name === 'type') return 'checkbox'
98+
if (name === 'id') return 'currentPasswordCheckbox'
9899
}
99-
};
100+
}
100101
//mock focus event
101-
var mockFocus = sinon.spy(element.find('input')[0], 'focus');
102+
var mockFocus = sinon.spy(element.find('input')[0], 'focus')
102103
// trigger event
103-
pwsIntputElement.trigger(e);
104+
pwsIntputElement.trigger(e)
104105

105106
// focus should be called once
106-
expect(mockFocus).to.be.calledOnce;
107+
expect(mockFocus).to.be.calledOnce
107108
// password field placeholde should be empty
108-
expect(scope.currentPasswordPlaceholder).to.exist.to.equal('');
109-
});
109+
expect(scope.currentPasswordPlaceholder).to.exist.to.equal('')
110+
})
110111

111112
it('should change type of input field to be text ', function() {
112-
var pwsIntputElement = angular.element(element.find('input')[0]);
113-
var checkbox = angular.element(element.find('input')[1]);
113+
var pwsIntputElement = angular.element(element.find('input')[0])
114+
var checkbox = angular.element(element.find('input')[1])
114115
// before clicking on checkbox, it should have password type
115-
expect(pwsIntputElement.attr('type')).to.equal('password');
116-
checkbox.trigger('click');
116+
expect(pwsIntputElement.attr('type')).to.equal('password')
117+
checkbox.trigger('click')
117118
// after clicking on checkbox, it should have text type
118-
expect(pwsIntputElement.attr('type')).to.equal('text');
119-
});
119+
expect(pwsIntputElement.attr('type')).to.equal('text')
120+
})
120121

121122
it('should change type of input field to be password ', function() {
122-
var pwsIntputElement = angular.element(element.find('input')[0]);
123-
var checkbox = angular.element(element.find('input')[1]);
123+
var pwsIntputElement = angular.element(element.find('input')[0])
124+
var checkbox = angular.element(element.find('input')[1])
124125
// before clicking on checkbox, it should have password type
125-
expect(pwsIntputElement.attr('type')).to.equal('password');
126-
checkbox.trigger('click');
126+
expect(pwsIntputElement.attr('type')).to.equal('password')
127+
checkbox.trigger('click')
127128
// after clicking on checkbox, it should have text type
128-
expect(pwsIntputElement.attr('type')).to.equal('text');
129+
expect(pwsIntputElement.attr('type')).to.equal('text')
129130
// click again to uncheck the checkbox
130-
checkbox.trigger('click');
131+
checkbox.trigger('click')
131132
// after unchecking the checkbox, it should have password type
132-
expect(pwsIntputElement.attr('type')).to.equal('password');
133-
});
133+
expect(pwsIntputElement.attr('type')).to.equal('password')
134+
})
134135

135136
it('should trigger keyup handler with enter/return key ', function() {
136-
var mockBlur = sinon.spy(element.find('input')[0], 'blur');
137-
var e = jQuery.Event("keyup");
138-
e.keyCode = 13;
139-
element.trigger(e);
140-
expect(mockBlur).to.be.calledOnce;
141-
});
137+
var mockBlur = sinon.spy(element.find('input')[0], 'blur')
138+
var e = jQuery.Event('keyup')
139+
e.keyCode = 13
140+
element.trigger(e)
141+
expect(mockBlur).to.be.calledOnce
142+
})
142143

143144
it('should NOT trigger keyup handler with non enter/return key ', function() {
144-
var mockBlur = sinon.spy(element.find('input')[0], 'blur');
145-
var e = jQuery.Event("keyup");
146-
e.keyCode = 14;
147-
element.trigger(e);
148-
expect(mockBlur).not.to.be.called;
149-
});
150-
});
151-
});
145+
var mockBlur = sinon.spy(element.find('input')[0], 'blur')
146+
var e = jQuery.Event('keyup')
147+
e.keyCode = 14
148+
element.trigger(e)
149+
expect(mockBlur).not.to.be.called
150+
})
151+
})
152+
})
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1+
import angular from 'angular'
2+
13
(function() {
2-
'use strict';
4+
'use strict'
35

4-
angular.module('tcUIComponents').directive('validEmail', validEmail);
6+
angular.module('tcUIComponents').directive('validEmail', validEmail)
57

68
function validEmail() {
79
return {
810
require: 'ngModel',
911
link: function(scope, element, attrs, ctrl) {
1012
ctrl.$validators.validEmail = function(modelValue, viewValue) {
1113
if (ctrl.$isEmpty(modelValue)) {
12-
return true;
14+
return true
1315
}
1416

1517
if (/.+@.+\..+/.test(viewValue)) {
16-
return true;
18+
return true
1719
}
1820

19-
scope.vm.emailErrorMessage = 'Please enter a valid email address.';
20-
return false;
21-
};
21+
scope.vm.emailErrorMessage = 'Please enter a valid email address.'
22+
return false
23+
}
2224
}
23-
};
25+
}
2426
}
25-
})();
27+
})()

0 commit comments

Comments
 (0)