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

OZG-4528 add test for isFirma

parent b5dcc9f1
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
const noAntragsteller: string = '[data-test-id="no-antragsteller"]';
const antragsteller: Antragsteller = createAntragsteller();
const antragstellerWithoutCompany = { ...antragsteller, firmaName: '' };
beforeEach(async () => {
await TestBed.configureTestingModule({
......@@ -75,7 +76,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
describe('full name', () => {
it('should be visible, if applicant is not company', () => {
component.antragsteller = { ...antragsteller, firmaName: '' };
component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerName);
......@@ -94,11 +95,10 @@ describe('VorgangDetailAntragstellerComponent', () => {
it('should not be visible, if contact person name is empty', () => {
component.antragsteller = {
...antragsteller,
...antragstellerWithoutCompany,
anrede: '',
vorname: '',
nachname: '',
firmaName: '',
};
fixture.detectChanges();
......@@ -130,7 +130,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
});
it('should not be visible, if applicant is not company', () => {
component.antragsteller = { ...antragsteller, firmaName: '' };
component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerAnsprechspartnerName);
......@@ -159,7 +159,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
});
it('should not be visible', () => {
component.antragsteller = { ...antragsteller, firmaName: '' };
component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerFirmaName);
......@@ -167,6 +167,23 @@ describe('VorgangDetailAntragstellerComponent', () => {
expect(element).not.toBeInstanceOf(HTMLElement);
});
});
describe('isFirma', () => {
it('should return true', () => {
component.antragsteller = antragsteller;
const isFirma = component.isFirma;
expect(isFirma).toBeTruthy;
});
it('should return false', () => {
component.antragsteller = antragstellerWithoutCompany;
const isFirma = component.isFirma;
expect(isFirma).toBeFalsy;
});
});
describe('email', () => {
it('should be visible', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment