Skip to content
Snippets Groups Projects
Commit 62c77863 authored by OZGCloud's avatar OZGCloud
Browse files

Revert "OZG-6720 adopt test"

This reverts commit 7a6b378e.
parent 438c9f37
Branches
Tags
No related merge requests found
import { AdminOrganisationsEinheitResource, AdminOrganisationsEinheitSettings } from '@admin-client/admin-settings';
import { AdminOrganisationsEinheitResource } from '@admin-client/admin-settings';
import { EMPTY_STRING, StateResource, createStateResource } from '@alfa-client/tech-shared';
import { Mock, mock, useFromMock } from '@alfa-client/test-utils';
import { FormBuilder } from '@angular/forms';
......@@ -24,7 +24,6 @@ describe('OrganisationsEinheitFormService', () => {
describe('submit', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource();
const organisationsEinheitSettings: AdminOrganisationsEinheitSettings = { signatur: faker.lorem.word(2) };
beforeEach(() => {
const stateResource: StateResource<AdminOrganisationsEinheitResource> = createStateResource(organisationsEinheitResource);
......@@ -33,19 +32,12 @@ describe('OrganisationsEinheitFormService', () => {
service.form.setValue({
[OrganisationsEinheitFormService.ORGANISATIONSEINHEIT_SIGNATUR_FIELD]: organisationsEinheitResource.settings.signatur,
});
service.buildPatchedOrganisationsEinheitSettings = jest.fn().mockReturnValue(organisationsEinheitSettings);
});
it('should call organisationsEinheitService patch', () => {
service.submit();
expect(organisationsEinheitService.patch).toHaveBeenCalledWith(organisationsEinheitSettings);
});
it('should build patched form value', () => {
service.submit();
expect(service.buildPatchedOrganisationsEinheitSettings).toHaveBeenCalled();
expect(organisationsEinheitService.patch).toHaveBeenCalledWith(organisationsEinheitResource.settings);
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment