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