This commit is contained in:
Bastian Wagner
2026-07-16 09:49:22 +02:00
commit 543e8273a7
157 changed files with 22761 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { TestBed } from '@angular/core/testing';
import { of } from 'rxjs';
import { ApiClientService } from '@boilerplate/api-client';
import { ItemsPageComponent } from './items.page';
describe('ItemsPageComponent', () => {
it('keeps the save button disabled while the typed form is invalid', async () => {
await TestBed.configureTestingModule({
imports: [ItemsPageComponent],
providers: [
{
provide: ApiClientService,
useValue: {
items: () => of({ items: [], total: 0, page: 1, pageSize: 20 }),
},
},
],
}).compileComponents();
const fixture = TestBed.createComponent(ItemsPageComponent);
fixture.detectChanges();
expect(fixture.componentInstance.form.invalid).toBe(true);
fixture.componentInstance.form.controls.name.setValue('Neues Item');
expect(fixture.componentInstance.form.valid).toBe(true);
});
});