users.getFirstTableCell(user_id).should('exist');
});
+ it('should show user key details', () => {
+ users.checkUserKeys(user_name);
+ });
+
it('should edit users full name, email and max buckets', () => {
users.edit(user_name, 'Another Identity', 'changed@othersite.com', '1969');
});
this.navigateTo();
this.delete(tenant + '$' + uname, null, null, true, false, false, true);
}
+
+ checkUserKeys(user_name: string) {
+ this.getExpandCollapseElement(user_name).should('be.visible').click();
+ cy.get('cd-table').contains('td', user_name).click();
+ cy.get('cd-rgw-user-details cd-table').eq(0).first().click();
+ cy.get("[aria-label='Show']").should('exist').click();
+ cy.get('input#user').should('exist');
+ cy.get('input#access_key').should('exist');
+ cy.get('input#secret_key').should('exist');
+ cy.get('cds-modal').should('exist');
+ }
}
component.keysSelection.first = () => {
return { type: 'S3', ref: { user: '', access_key: '', secret_key: '' } };
};
- const modalShowSpy = spyOn(component['modalService'], 'show').and.callFake(() => {
+ const modalShowSpy = spyOn(component['cdsModalService'], 'show').and.callFake(() => {
modalRef = {
- componentInstance: {
- setValues: jest.fn(),
- setViewing: jest.fn()
- }
+ setValues: jest.fn(),
+ setViewing: jest.fn()
};
return modalRef;
});
component.keysSelection.first = () => {
return { type: 'Swift', ref: { user: '', access_key: '', secret_key: '' } };
};
- const modalShowSpy = spyOn(component['modalService'], 'show').and.callFake(() => {
+ const modalShowSpy = spyOn(component['cdsModalService'], 'show').and.callFake(() => {
modalRef = {
- componentInstance: {
- setValues: jest.fn(),
- setViewing: jest.fn()
- }
+ setValues: jest.fn(),
+ setViewing: jest.fn()
};
return modalRef;
});
import { Icons } from '~/app/shared/enum/icons.enum';
import { CdTableColumn } from '~/app/shared/models/cd-table-column';
import { CdTableSelection } from '~/app/shared/models/cd-table-selection';
-import { ModalService } from '~/app/shared/services/modal.service';
import { RgwUserS3Key } from '../models/rgw-user-s3-key';
import { RgwUserSwiftKey } from '../models/rgw-user-swift-key';
import { RgwUserS3KeyModalComponent } from '../rgw-user-s3-key-modal/rgw-user-s3-key-modal.component';
import { CdTableAction } from '~/app/shared/models/cd-table-action';
import { Permissions } from '~/app/shared/models/permissions';
import { RgwRateLimitConfig } from '../models/rgw-rate-limit';
+import { ModalCdsService } from '~/app/shared/services/modal-cds.service';
@Component({
selector: 'cd-rgw-user-details',
icons = Icons;
- constructor(private rgwUserService: RgwUserService, private modalService: ModalService) {}
+ constructor(private rgwUserService: RgwUserService, private cdsModalService: ModalCdsService) {}
ngOnInit() {
this.keysColumns = [
showKeyModal() {
const key = this.keysSelection.first();
- const modalRef = this.modalService.show(
+ const modalRef = this.cdsModalService.show(
key.type === 'S3' ? RgwUserS3KeyModalComponent : RgwUserSwiftKeyModalComponent
);
switch (key.type) {
case 'S3':
- modalRef.componentInstance.setViewing();
- modalRef.componentInstance.setValues(key.ref.user, key.ref.access_key, key.ref.secret_key);
+ modalRef.setViewing();
+ modalRef.setValues(key.ref.user, key.ref.access_key, key.ref.secret_key);
break;
case 'Swift':
- modalRef.componentInstance.setValues(key.ref.user, key.ref.secret_key);
+ modalRef.setValues(key.ref.user, key.ref.secret_key);
break;
}
}