Skip to content

Commit

Permalink
initial model and directive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 16, 2018
1 parent 2827be1 commit 2c7f4b1
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/repo/abstractAppRepo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.service("AbstractAppRepo", function () {
app.service("AbstractAppRepo", function AbstractAppRepo() {

return function AbstractAppRepo() {

Expand Down
15 changes: 15 additions & 0 deletions tests/unit/directives/customHeaderDirectiveTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe('directive: customHeader', function () {

var scope, element;

beforeEach(function () {
module('core');
module('app');
module('views/directives/header.html');
inject(function ($rootScope, _$compile_) {
scope = $rootScope.$new();
$compile = _$compile_;
});
});

});
43 changes: 43 additions & 0 deletions tests/unit/directives/remoteProjectManagerFormDirectiveTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
describe('directive: remoteProjectManagerForm', function () {

var scope, element;

beforeEach(function () {
module('core');
module('app');
module('views/directives/remoteProjectManagerForm.html');
inject(function ($rootScope, _$compile_) {
scope = $rootScope.$new();
$compile = _$compile_;

scope.model = {
name: '',
type: ''
};
scope.settings = [{
"type": "text",
"key": "url",
"gloss": "URL",
"visible": true
}, {
"type": "text",
"key": "username",
"gloss": "Username",
"visible": false
}, {
"type": "password",
"key": "password",
"gloss": "Password",
"visible": false
}, {
"type": "password",
"key": "token",
"gloss": "Token",
"visible": false
}];
element = $compile('<remote-project-manager-form management-settings="settings" model="model"></remote-project-manager-form>')(scope);
scope.$apply();
});
});

});
23 changes: 23 additions & 0 deletions tests/unit/model/abstractAppModelTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('model: AbstractAppModel', function () {

var AbstractAppModel;

beforeEach(function () {
module('core');
module('app');
module('mock.wsApi');
inject(function (_$rootScope_, _$q_, _WsApi_, _AbstractAppModel_) {
$rootScope = _$rootScope_;
$q = _$q_;
WsApi = _WsApi_;
AbstractAppModel = _AbstractAppModel_;
});
});

describe('Is the model defined', function () {
it('should be defined', function () {
expect(AbstractAppModel).toBeDefined();
});
});

});
23 changes: 23 additions & 0 deletions tests/unit/model/projectTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('model: Project', function () {

var Project;

beforeEach(function () {
module('core');
module('app');
module('mock.wsApi');
inject(function (_$rootScope_, _$q_, _WsApi_, _Project_) {
$rootScope = _$rootScope_;
$q = _$q_;
WsApi = _WsApi_;
Project = _Project_;
});
});

describe('Is the model defined', function () {
it('should be defined', function () {
expect(Project).toBeDefined();
});
});

});
23 changes: 23 additions & 0 deletions tests/unit/model/remoteProjectManagerTetst.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('model: RemoteProjectManager', function () {

var RemoteProjectManager;

beforeEach(function () {
module('core');
module('app');
module('mock.wsApi');
inject(function (_$rootScope_, _$q_, _WsApi_, _RemoteProjectManager_) {
$rootScope = _$rootScope_;
$q = _$q_;
WsApi = _WsApi_;
RemoteProjectManager = _RemoteProjectManager_;
});
});

describe('Is the model defined', function () {
it('should be defined', function () {
expect(RemoteProjectManager).toBeDefined();
});
});

});
23 changes: 23 additions & 0 deletions tests/unit/model/statusTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('model: Status', function () {

var Status;

beforeEach(function () {
module('core');
module('app');
module('mock.wsApi');
inject(function (_$rootScope_, _$q_, _WsApi_, _Status_) {
$rootScope = _$rootScope_;
$q = _$q_;
WsApi = _WsApi_;
Status = _Status_;
});
});

describe('Is the model defined', function () {
it('should be defined', function () {
expect(Status).toBeDefined();
});
});

});
15 changes: 0 additions & 15 deletions tests/unit/models/assumedControlModelTest.js

This file was deleted.

7 changes: 0 additions & 7 deletions tests/unit/models/userModelTest.js

This file was deleted.

0 comments on commit 2c7f4b1

Please sign in to comment.