Skip to content

Commit

Permalink
remove duplicated schema test
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Feb 25, 2017
1 parent d2e30d8 commit c8e71b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
16 changes: 15 additions & 1 deletion opal/static/js/test/schema.service.test.js
Expand Up @@ -35,8 +35,18 @@ describe('schema', function(){
"type":"string"
}
]
},
{
name: "diagnosis",
single: false,
sort: 'date_of_diagnosis',
fields: [
{name: 'date_of_diagnosis', type: 'date'},
{name: 'condition', type: 'string'},
{name: 'provisional', type: 'boolean'},
]
}
]
];

beforeEach(function(){
module('opal.services');
Expand All @@ -60,6 +70,7 @@ describe('schema', function(){
it('should recognise singletons', function(){
expect(schema.isSingleton("demographics")).toBeFalsy();
expect(schema.isSingleton("tagging")).toBeTruthy();
expect(schema.isSingleton("diagnosis")).not.toBeTruthy();
});

it('should recognise read only', function(){
Expand All @@ -71,4 +82,7 @@ describe('schema', function(){
expect(schema.getAdvancedSearchColumns()).toEqual([exampleSchemaData[1]]);
});

it('should be able to get the number of columns', function() {
expect(schema.getNumberOfColumns()).toBe(3);
});
});
28 changes: 0 additions & 28 deletions opal/static/js/test/servicesTest.js
Expand Up @@ -123,34 +123,6 @@ describe('services', function() {
});
});

describe('Schema', function() {
var Schema, schema;

beforeEach(function() {
module('opal.services', function($provide) {
$provide.value('UserProfile', function(){ return profile; });
});

inject(function($injector) {
Schema = $injector.get('Schema');
});
schema = new Schema(_.values(columns.fields));
});

it('should be able to get the number of columns', function() {
expect(schema.getNumberOfColumns()).toBe(2);
});

it('should be able to get a column', function() {
expect(schema.getColumn('diagnosis').name).toBe('diagnosis');
});

it('should know whether a column is a singleton', function() {
expect(schema.isSingleton('demographics')).toBe(true);
expect(schema.isSingleton('diagnosis')).toBe(false);
});
});

describe('episodeLoader', function() {
var episodeLoader, $httpBackend;

Expand Down

0 comments on commit c8e71b3

Please sign in to comment.