Update app tests
This commit is contained in:
parent
a6f23951a5
commit
a6dcab34f2
@ -108,22 +108,34 @@ global.SettingsServiceMock = function() {
|
||||
var userList = [
|
||||
{ id: 1, username: 'tester', security_level: 2 },
|
||||
{ id: 2, username: 'test', security_level: 3, default_board_id: 0 }
|
||||
],
|
||||
boardsList = [
|
||||
{ id: 1, name: 'Testing' }
|
||||
];
|
||||
|
||||
return {
|
||||
usersChanged: RxJs.Observable.of(userList),
|
||||
boardsChanged: RxJs.Observable.of(boardsList),
|
||||
|
||||
updateUsers: (users) => {
|
||||
userList = [];
|
||||
userList = users;
|
||||
},
|
||||
getUsers: () => {
|
||||
return RxJs.Observable.of({
|
||||
status: 'success',
|
||||
alerts: [],
|
||||
data: [
|
||||
null,
|
||||
userList
|
||||
]
|
||||
data: [ null, userList ]
|
||||
});
|
||||
},
|
||||
|
||||
updateBoards: (boards) => {
|
||||
boardsList = boards;
|
||||
},
|
||||
getBoards: () => {
|
||||
return RxJs.Observable.of({
|
||||
status: 'success',
|
||||
alerts: [],
|
||||
data: [ null, boardsList ]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global expect AuthServiceMock SettingsServiceMock ModalServiceMock */
|
||||
/* global expect AuthServiceMock SettingsServiceMock ModalServiceMock NotificationsServiceMock */
|
||||
var path = '../../../../build/settings/board-admin/',
|
||||
BoardAdmin = require(path + 'board-admin.component.js').BoardAdmin,
|
||||
DragulaService = require('../../../../node_modules/ng2-dragula/src/app/providers/dragula.provider.js')
|
||||
@ -9,7 +9,8 @@ describe('BoardAdmin', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
boardAdmin = new BoardAdmin(AuthServiceMock, new ModalServiceMock(),
|
||||
new SettingsServiceMock(), new DragulaService());
|
||||
new SettingsServiceMock(), new NotificationsServiceMock(),
|
||||
new DragulaService());
|
||||
});
|
||||
|
||||
it('has a function to get a color', () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* global expect AuthServiceMock NotificationsServiceMock UserSettingsServiceMock */
|
||||
/* global expect AuthServiceMock NotificationsServiceMock SettingsServiceMock UserSettingsServiceMock */
|
||||
var path = '../../../../build/settings/user-settings/',
|
||||
UserSettings = require(path + 'user-settings.component.js').UserSettings;
|
||||
|
||||
@ -9,7 +9,8 @@ describe('UserSettings', () => {
|
||||
beforeEach(() => {
|
||||
notifications = new NotificationsServiceMock();
|
||||
userSettings = new UserSettings(AuthServiceMock,
|
||||
notifications, UserSettingsServiceMock);
|
||||
notifications, new SettingsServiceMock(),
|
||||
UserSettingsServiceMock);
|
||||
});
|
||||
|
||||
it('resets forms on init', () => {
|
||||
|
Reference in New Issue
Block a user