From: Lenz Grimmer Date: Fri, 23 Oct 2020 11:57:51 +0000 (+0200) Subject: Merge pull request #37440 from Devp00l/wip-44433 X-Git-Tag: v16.1.0~776 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2564dd4b09b5ff523788a424cb55fbf4378c5757;p=ceph.git Merge pull request #37440 from Devp00l/wip-44433 mgr/dashboard: Add clay plugin support Reviewed-by: Laura Paduano Reviewed-by: Tiago Melo --- 2564dd4b09b5ff523788a424cb55fbf4378c5757 diff --cc src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts index a42a51f4f995,1f01a8f1af05..9a7cb43674b6 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form-modal.component.spec.ts @@@ -25,10 -26,35 +25,29 @@@ describe('ErasureCodeProfileFormModalCo let fixture: ComponentFixture; let formHelper: FormHelper; let fixtureHelper: FixtureHelper; - let data: {}; + let data: { plugins: string[]; names: string[]; nodes: CrushNode[] }; + + const expectTechnique = (current: string) => + expect(component.form.getValue('technique')).toBe(current); + + const expectTechniques = (techniques: string[], current: string) => { + expect(component.techniques).toEqual(techniques); + expectTechnique(current); + }; + + const expectRequiredControls = (controlNames: string[]) => { + controlNames.forEach((name) => { + const value = component.form.getValue(name); + formHelper.expectValid(name); + formHelper.expectErrorChange(name, null, 'required'); + // This way other fields won't fail through getting invalid. + formHelper.expectValidChange(name, value); + }); + fixtureHelper.expectIdElementsVisible(controlNames, true); + }; configureTestBed({ - imports: [ - HttpClientTestingModule, - RouterTestingModule, - ToastrModule.forRoot(), - PoolModule, - NgBootstrapFormValidationModule.forRoot() - ], + imports: [HttpClientTestingModule, RouterTestingModule, ToastrModule.forRoot(), PoolModule], providers: [ErasureCodeProfileService, NgbActiveModal] });