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

Commit 7e2d51a

Browse files
author
vikasrohit
committed
SUP-2899, Reliability detail link from Profiles is wrong.
-- Unit test for mapReliability function
1 parent 1a42beb commit 7e2d51a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

app/services/userStats.service.spec.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,5 +382,60 @@ describe('User Stats Service', function() {
382382
});
383383
});
384384

385+
describe('mapReliability ', function() {
386+
it('should map each subtrack to correct project type ', function() {
387+
var pt1 = ['DESIGN', 'DEVELOPMENT', 'TESTING_COMPETITION'];
388+
var pt2 = [
389+
'SPECIFICATION',
390+
'ARCHITECTURE',
391+
'COMPONENT_PRODUCTION',
392+
'BUG_HUNT', 'DEPLOYMENT',
393+
'SECURITY', 'PROCESS',
394+
'TEST_SUITES',
395+
'ASSEMBLY_COMPETITION',
396+
'LEGACY',
397+
'UI_PROTOTYPE_COMPETITION',
398+
'CONCEPTUALIZATION',
399+
'RIA_BUILD_COMPETITION',
400+
'RIA_COMPONENT_COMPETITION',
401+
'TEST_SCENARIOS',
402+
'SPEC_REVIEW',
403+
'COPILOT_POSTING',
404+
'CONTENT_CREATION',
405+
'REPORTING',
406+
'MARATHON_MATCH',
407+
'FIRST_2_FINISH',
408+
'CODE'
409+
];
410+
var pt3 = [
411+
'BANNERS_OR_ICONS',
412+
'WEB_DESIGN',
413+
'WIREFRAMES',
414+
'LOGO_DESIGN',
415+
'PRINT_OR_PRESENTATION',
416+
'DESIGN_FIRST_2_FINISH',
417+
'WIDGET_OR_MOBILE_SCREEN_DESIGN',
418+
'FRONT_END_FLASH',
419+
'APPLICATION_FRONT_END_DESIGN',
420+
'STUDIO_OTHER',
421+
'IDEA_GENERATION'];
422+
var pt4 = ['GENERIC_SCORECARDS'];
423+
pt1.forEach(function(subTrack) {
424+
expect(UserStatsService.mapReliability(subTrack)).to.equal(1);
425+
});
426+
pt2.forEach(function(subTrack) {
427+
expect(UserStatsService.mapReliability(subTrack)).to.equal(2);
428+
});
429+
pt3.forEach(function(subTrack) {
430+
expect(UserStatsService.mapReliability(subTrack)).to.equal(3);
431+
});
432+
pt4.forEach(function(subTrack) {
433+
expect(UserStatsService.mapReliability(subTrack)).to.equal(4);
434+
});
435+
// for any other subtrack it should return 2
436+
expect(UserStatsService.mapReliability('unkown')).to.equal(2);
437+
438+
});
439+
});
385440

386441
});

0 commit comments

Comments
 (0)