This commit is contained in:
parent
191fe4ebf6
commit
db55c3e81b
|
@ -9,6 +9,7 @@ describe('component vnUserAliases', () => {
|
|||
beforeEach(inject(($componentController, _$httpBackend_) => {
|
||||
$httpBackend = _$httpBackend_;
|
||||
controller = $componentController('vnUserAliases', {$element: null});
|
||||
controller.$params.id = 1;
|
||||
jest.spyOn(controller.vnApp, 'showSuccess');
|
||||
}));
|
||||
|
||||
|
@ -26,7 +27,7 @@ describe('component vnUserAliases', () => {
|
|||
it('should add the new row', () => {
|
||||
controller.addData = {account: 1};
|
||||
|
||||
$httpBackend.expectPOST('MailAliasAccounts').respond();
|
||||
$httpBackend.expectPOST(`Accounts/${controller.$params.id}/addMailAlias`).respond();
|
||||
$httpBackend.expectGET('MailAliasAccounts').respond('foo');
|
||||
controller.onAddSave();
|
||||
$httpBackend.flush();
|
||||
|
@ -42,7 +43,7 @@ describe('component vnUserAliases', () => {
|
|||
{id: 2, alias: 'bar'}
|
||||
];
|
||||
|
||||
$httpBackend.expectDELETE('MailAliasAccounts/1').respond();
|
||||
$httpBackend.expectPOST(`Accounts/${controller.$params.id}/deleteMailAlias`).respond();
|
||||
controller.onRemove(controller.$.data[0]);
|
||||
$httpBackend.flush();
|
||||
|
||||
|
|
Loading…
Reference in New Issue