mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
Made uuid in hall of heroes populate the input box
This commit is contained in:
parent
ddc91e0227
commit
24ef3aa012
3 changed files with 33 additions and 1 deletions
28
test/spec/hallCtrlSpec.js
Normal file
28
test/spec/hallCtrlSpec.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
'use strict';
|
||||
|
||||
describe.only('Hall of Heroes Controller', function() {
|
||||
var scope, ctrl, user, $rootScope;
|
||||
|
||||
beforeEach(function() {
|
||||
module(function($provide) {
|
||||
$provide.value('User', {});
|
||||
});
|
||||
|
||||
inject(function($rootScope, $controller){
|
||||
user = specHelper.newUser();
|
||||
user._id = "unique-user-id"
|
||||
|
||||
scope = $rootScope.$new();
|
||||
|
||||
// Load RootCtrl to ensure shared behaviors are loaded
|
||||
$controller('RootCtrl', {$scope: scope, User: {user: user}});
|
||||
|
||||
ctrl = $controller('HallHeroesCtrl', {$scope: scope, User: {user: user}});
|
||||
});
|
||||
});
|
||||
|
||||
it('populates contributor input with selected hero id', function(){
|
||||
scope.populateContributorInput(user._id);
|
||||
expect(scope._heroID).to.eql(user._id);
|
||||
});
|
||||
});
|
||||
|
|
@ -17,6 +17,10 @@ habitrpg.controller("HallHeroesCtrl", ['$scope', '$rootScope', 'User', 'Notifica
|
|||
})
|
||||
}
|
||||
$scope.heroes = Hero.query();
|
||||
|
||||
$scope.populateContributorInput = function(id) {
|
||||
$scope._heroID = id;
|
||||
};
|
||||
}]);
|
||||
|
||||
habitrpg.controller("HallPatronsCtrl", ['$scope', '$rootScope', 'User', 'Notification', 'ApiUrl', '$resource',
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ script(type='text/ng-template', id='partials/options.social.hall.heroes.html')
|
|||
span(ng-class='userAdminGlyphiconStyle(hero)')
|
||||
span(ng-if='!hero.contributor.admin')
|
||||
a.label.label-default(ng-class='userLevelStyle(hero)', ng-click='clickMember(hero._id, true)') {{hero.profile.name}}
|
||||
td(ng-if='user.contributor.admin') {{hero._id}}
|
||||
td(ng-if='user.contributor.admin', ng-click='populateContributorInput(hero._id)').btn-link {{hero._id}}
|
||||
td {{hero.contributor.level}}
|
||||
td {{hero.contributor.text}}
|
||||
td
|
||||
|
|
|
|||
Loading…
Reference in a new issue