Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(table): fix title
Browse files Browse the repository at this point in the history
Fixes table title to match spec again
Add test to prevent further regressoin
Closes 348
  • Loading branch information
Daniel Stern committed Mar 12, 2015
1 parent 7dee7e7 commit 6bbb65f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/scripts/projects/projects.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ module ngApp.projects.controllers {


if (this.ProjectsState.tabs.graph.active) {
githutTable(data,{filters:{file_size:this.$filter('size')}});
githutTable(data,{filters:{file_size:this.$filter('size')},heading:this.ProjectsService.getTableHeading()});
}
});
} else {
this.tabSwitch = false;
if (this.ProjectsState.tabs.graph.active) {
githutTable(this.projects,{filters:{file_size:this.$filter('size')}});
githutTable(this.projects,{filters:{file_size:this.$filter('size')},heading:this.ProjectsService.getTableHeading()});
}
}
}
Expand Down Expand Up @@ -324,7 +324,7 @@ function githutTable(data,config){
superhead:{
start:'Clinical',
end:'Other',
text:'DATA TYPES'
text:config.heading //Participant count per data type
},

/**
Expand Down
4 changes: 4 additions & 0 deletions app/scripts/projects/projects.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module ngApp.projects.services {
return response["data"];
});
}

getTableHeading() {
return 'Participant count per data type';
}

getProjects(params: Object = {}): ng.IPromise<IProjects> {
if (params.hasOwnProperty("fields")) {
Expand Down
4 changes: 4 additions & 0 deletions app/scripts/projects/tests/projects.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@ describe('Projects:', function () {
expect(ProjectsService.ds.get).to.have.been.calledOnce;
expect(ProjectsService.ds.get).to.have.been.calledWith(1);
}));

it('title of table should match spec', inject(function (ProjectsService) {
assert.equal(ProjectsService.getTableHeading(),'Participant count per data type');
}));
});
});

0 comments on commit 6bbb65f

Please sign in to comment.