Skip to content
Snippets Groups Projects
Verified Commit b16be9d4 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-6988 add form component

Sub task: OZG-7446
parent 8705e4b6
No related branches found
No related tags found
1 merge request!27OZG-6988 implement button
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
--> -->
<h1 class="heading-1" data-test-id="statistik-header-text">Statistik</h1> <h1 class="heading-1" data-test-id="statistik-header-text">Statistik</h1>
@if (!evaluateAdditionalFields) { @if (evaluateAdditionalFields) {
<admin-statistik-fields-form data-test-id="statistik-fields-form"></admin-statistik-fields-form>
} @else {
<ods-button <ods-button
text="Weitere Felder auswerten" text="Weitere Felder auswerten"
(clickEmitter)="onEvaluateAdditionalFields()" (clickEmitter)="onEvaluateAdditionalFields()"
......
...@@ -31,6 +31,7 @@ describe('StatistikContainerComponent', () => { ...@@ -31,6 +31,7 @@ describe('StatistikContainerComponent', () => {
let fixture: ComponentFixture<StatistikContainerComponent>; let fixture: ComponentFixture<StatistikContainerComponent>;
const evaluateAdditionalFieldsTestId: string = getDataTestIdOf('weitere-felder-auswerten-button'); const evaluateAdditionalFieldsTestId: string = getDataTestIdOf('weitere-felder-auswerten-button');
const statistikFieldsFormTestId: string = getDataTestIdOf('statistik-fields-form');
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
...@@ -100,5 +101,23 @@ describe('StatistikContainerComponent', () => { ...@@ -100,5 +101,23 @@ describe('StatistikContainerComponent', () => {
}); });
}); });
}); });
describe('stastik fields form', () => {
it('should exists', () => {
component.evaluateAdditionalFields = true;
fixture.detectChanges();
existsAsHtmlElement(fixture, statistikFieldsFormTestId);
});
it('should NOT exists', () => {
component.evaluateAdditionalFields = false;
fixture.detectChanges();
notExistsAsHtmlElement(fixture, statistikFieldsFormTestId);
});
});
}); });
}); });
...@@ -24,12 +24,13 @@ ...@@ -24,12 +24,13 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { ButtonComponent } from '@ods/system'; import { ButtonComponent } from '@ods/system';
import { AdminStatistikFieldsFormComponent } from './statistik-fields-form/admin-statistik-fields-form.component';
@Component({ @Component({
selector: 'admin-statistik-container', selector: 'admin-statistik-container',
templateUrl: './statistik-container.component.html', templateUrl: './statistik-container.component.html',
standalone: true, standalone: true,
imports: [CommonModule, ButtonComponent], imports: [CommonModule, ButtonComponent, AdminStatistikFieldsFormComponent],
}) })
export class StatistikContainerComponent { export class StatistikContainerComponent {
public evaluateAdditionalFields: boolean = false; public evaluateAdditionalFields: boolean = false;
......
<p>admin-statistik-fields-form works!</p>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AdminStatistikFieldsFormComponent } from './admin-statistik-fields-form.component';
describe('AdminStatistikFieldsFormComponent', () => {
let component: AdminStatistikFieldsFormComponent;
let fixture: ComponentFixture<AdminStatistikFieldsFormComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AdminStatistikFieldsFormComponent],
}).compileComponents();
fixture = TestBed.createComponent(AdminStatistikFieldsFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
@Component({
selector: 'admin-statistik-fields-form',
standalone: true,
imports: [CommonModule],
templateUrl: './admin-statistik-fields-form.component.html',
})
export class AdminStatistikFieldsFormComponent {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment