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

Commit 2d90cc1

Browse files
author
Nick Litwin
committed
Merge branch 'dev' into SUP-2935-tc-file-tests
2 parents 1a83d65 + 8bcf316 commit 2d90cc1

File tree

4 files changed

+379
-9
lines changed

4 files changed

+379
-9
lines changed

app/directives/badges/badge-tooltip.spec.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ describe('Badge Tooltip Directive', function() {
66
var spotlightChallenge = mockData.getMockSpotlightChallenges()[0];
77

88
beforeEach(function() {
9-
bard.appModule('tcUIComponents');
9+
bard.appModule('topcoder');
1010
bard.inject(this, '$compile', '$rootScope');
1111
scope = $rootScope.$new();
1212
});
1313

1414
bard.verifyNoOutstandingHttpRequests();
1515

16-
xdescribe('Badge Tooltip', function() {
16+
describe('Badge Tooltip', function() {
1717
var tooltip;
1818

1919
beforeEach(function() {
@@ -89,5 +89,18 @@ describe('Badge Tooltip Directive', function() {
8989
expect(dataDiv).not.to.null;
9090
expect(dataDiv.hasClass('ng-hide')).to.equal(true);
9191
});
92+
93+
it('should trigger mouseenter handler ', function() {
94+
tooltip.trigger('mouseenter');
95+
var tooltipElement = tooltip.children(0);
96+
expect(tooltipElement.css('z-index')).to.equal('2000');
97+
expect(tooltip.isolateScope().hide).to.equal(false);
98+
});
99+
100+
it('should trigger mouseleave handler ', function() {
101+
tooltip.trigger('mouseleave');
102+
tooltipElement = tooltip.children(0);
103+
expect(tooltip.isolateScope().hide).to.equal(true);
104+
});
92105
});
93106
});

app/filters/npad.filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
if(inputStr.length >= n)
1515
return inputStr
16-
var zeros = "0".repeat(n);
16+
var zeros = new Array( n + 1 ).join("0");
1717
return (zeros + inputStr).slice(-1 * n)
1818
};
1919
}

app/services/helpers.service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
answer: '' + q.answer
157157
};
158158

159-
if (q.comment.length > 0) {
159+
if (q.comment && q.comment.length > 0) {
160160
reviewItem.comments = [
161161
{
162162
content: '' + q.comment,
@@ -234,7 +234,7 @@
234234
});
235235
// now loop over all keys and replace with compiled value
236236
Object.keys(compiledMap).forEach(function(k) {
237-
template = template.replace(k, compiledMap[k])
237+
template = template.replace(k, (compiledMap[k] ? compiledMap[k] : ''));
238238
});
239239
}
240240
return template;
@@ -298,8 +298,8 @@
298298
}
299299

300300
function setupLoginEventMetrics (usernameOrEmail) {
301-
if (_kmq) {
302-
_kmq.push(['identify', usernameOrEmail ]);
301+
if ($window._kmq) {
302+
$window._kmq.push(['identify', usernameOrEmail ]);
303303
}
304304
}
305305

0 commit comments

Comments
 (0)