From: Lenz Grimmer Date: Thu, 8 Nov 2018 17:09:38 +0000 (+0100) Subject: Merge pull request #24719 from Devp00l/wip-issue-26861 X-Git-Tag: v14.1.0~968 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d9c9cf65f0c6ed434eb53bb08fec7799b38e3a76;p=ceph-ci.git Merge pull request #24719 from Devp00l/wip-issue-26861 mgr/dashboard: Remove _filterValue from CdFormGroup Reviewed-by: Patrick Nawracay Reviewed-by: Volker Theile --- d9c9cf65f0c6ed434eb53bb08fec7799b38e3a76 diff --cc src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts index 6a56c14bbfe,af77ad771c2..498c0fa0e58 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts @@@ -126,16 -122,37 +122,31 @@@ describe('RgwUserFormComponent', () => formHelper.expectErrorChange('user_id', '', 'required', true); }); - it( - 'should validate that username is valid', - fakeAsync(() => { - formHelper.setValue('user_id', 'ab', true); - tick(500); - formHelper.expectValid('user_id'); - }) - ); - - it( - 'should validate that username is invalid', - fakeAsync(() => { - formHelper.setValue('user_id', 'abc', true); - tick(500); - formHelper.expectError('user_id', 'notUnique'); - }) - ); + it('should validate that username is valid', fakeAsync(() => { + formHelper.setValue('user_id', 'ab', true); + tick(500); + formHelper.expectValid('user_id'); + })); + + it('should validate that username is invalid', fakeAsync(() => { + formHelper.setValue('user_id', 'abc', true); + tick(500); + formHelper.expectError('user_id', 'notUnique'); + })); }); + + describe('onSubmit', () => { + it('should be able to clear the mail field on update', () => { + spyOn(rgwUserService, 'update'); + component.editing = true; + formHelper.setValue('email', '', true); + component.onSubmit(); + expect(rgwUserService.update).toHaveBeenCalledWith(null, { + display_name: null, + email: '', + max_buckets: 1000, + suspended: false + }); + }); + }); });