]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #24719 from Devp00l/wip-issue-26861
authorLenz Grimmer <lenz@grimmer.com>
Thu, 8 Nov 2018 17:09:38 +0000 (18:09 +0100)
committerGitHub <noreply@github.com>
Thu, 8 Nov 2018 17:09:38 +0000 (18:09 +0100)
mgr/dashboard: Remove _filterValue from CdFormGroup

Reviewed-by: Patrick Nawracay <pnawracay@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
1  2 
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts

index 6a56c14bbfe29403c33b6cd8117072206b77f7b6,af77ad771c28bda93e51978d83ef0714bd8da1c7..498c0fa0e58bc57d0c9ca62b005aff63daa6adf9
@@@ -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
+       });
+     });
+   });
  });