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', () => { ...@@ -54,6 +54,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
const noAntragsteller: string = '[data-test-id="no-antragsteller"]'; const noAntragsteller: string = '[data-test-id="no-antragsteller"]';
const antragsteller: Antragsteller = createAntragsteller(); const antragsteller: Antragsteller = createAntragsteller();
const antragstellerWithoutCompany = { ...antragsteller, firmaName: '' };
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
...@@ -75,7 +76,7 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -75,7 +76,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
describe('full name', () => { describe('full name', () => {
it('should be visible, if applicant is not company', () => { it('should be visible, if applicant is not company', () => {
component.antragsteller = { ...antragsteller, firmaName: '' }; component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges(); fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerName); const element = getElementFromFixture(fixture, antragstellerName);
...@@ -94,11 +95,10 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -94,11 +95,10 @@ describe('VorgangDetailAntragstellerComponent', () => {
it('should not be visible, if contact person name is empty', () => { it('should not be visible, if contact person name is empty', () => {
component.antragsteller = { component.antragsteller = {
...antragsteller, ...antragstellerWithoutCompany,
anrede: '', anrede: '',
vorname: '', vorname: '',
nachname: '', nachname: '',
firmaName: '',
}; };
fixture.detectChanges(); fixture.detectChanges();
...@@ -130,7 +130,7 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -130,7 +130,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
}); });
it('should not be visible, if applicant is not company', () => { it('should not be visible, if applicant is not company', () => {
component.antragsteller = { ...antragsteller, firmaName: '' }; component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges(); fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerAnsprechspartnerName); const element = getElementFromFixture(fixture, antragstellerAnsprechspartnerName);
...@@ -159,7 +159,7 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -159,7 +159,7 @@ describe('VorgangDetailAntragstellerComponent', () => {
}); });
it('should not be visible', () => { it('should not be visible', () => {
component.antragsteller = { ...antragsteller, firmaName: '' }; component.antragsteller = antragstellerWithoutCompany;
fixture.detectChanges(); fixture.detectChanges();
const element = getElementFromFixture(fixture, antragstellerFirmaName); const element = getElementFromFixture(fixture, antragstellerFirmaName);
...@@ -167,6 +167,23 @@ describe('VorgangDetailAntragstellerComponent', () => { ...@@ -167,6 +167,23 @@ describe('VorgangDetailAntragstellerComponent', () => {
expect(element).not.toBeInstanceOf(HTMLElement); 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', () => { describe('email', () => {
it('should be visible', () => { 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