refs #5468 fix: fornt test
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-05-23 12:49:34 +02:00
parent 191fe4ebf6
commit db55c3e81b
1 changed files with 3 additions and 2 deletions

View File

@ -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();