From d8d7836e0420cd68242920e7f8e0f0292788e4b2 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Mon, 24 Feb 2025 14:53:54 +0530 Subject: [PATCH] mgr/dashboard: fix rgw and osd regression in e2e use aria-label as the selector in tests. data-testid is not supported through this carbon cds-checkbox input so we can't use it regression started after started after #61319 and https://github.com/ceph/ceph/pull/61478/files#diff-7bd2a1f48bd2a7bcebb744eb04d84706087b6b3c2651c4b1ad085b4b6e03fc6d where multi-select is removed Fixes: https://tracker.ceph.com/issues/68871 Signed-off-by: Nizamudeen A --- .../cypress/e2e/block/images.e2e-spec.ts | 4 ++-- .../cypress/e2e/block/mirroring.e2e-spec.ts | 2 +- .../frontend/cypress/e2e/cluster/hosts.po.ts | 2 +- .../cypress/e2e/cluster/logs.e2e-spec.ts | 2 +- .../e2e/common/forms-helper.feature.po.ts | 4 ++++ .../filesystems/filesystems.e2e-spec.feature | 2 +- .../filesystems/snapshots.e2e-spec.feature | 8 +++---- .../subvolume-groups.e2e-spec.feature | 4 ++-- .../filesystems/subvolumes.e2e-spec.feature | 4 ++-- .../02-create-cluster-add-host.feature | 2 +- .../workflow/09-services.e2e-spec.ts | 2 ++ .../frontend/cypress/e2e/page-helper.po.ts | 11 +++++++--- .../cypress/e2e/pools/pools.e2e-spec.ts | 4 ++-- .../cypress/e2e/rgw/buckets.e2e-spec.ts | 6 ++--- .../frontend/cypress/e2e/rgw/buckets.po.ts | 10 ++++----- .../cypress/e2e/rgw/configuration.e2e-spec.ts | 2 +- .../cypress/e2e/rgw/configuration.po.ts | 18 +++++++-------- .../cypress/e2e/rgw/users.e2e-spec.ts | 2 +- .../frontend/cypress/e2e/rgw/users.po.ts | 8 +++---- .../cypress/e2e/ui/notification.e2e-spec.ts | 2 +- .../cypress/e2e/ui/user-mgmt.e2e-spec.ts | 2 +- .../osd/osd-list/osd-list.component.html | 2 +- .../delete-confirmation-modal.component.html | 1 + .../dynamic-input-combobox.directive.spec.ts | 22 +++++++++---------- .../dynamic-input-combobox.directive.ts | 19 ++++++---------- 25 files changed, 75 insertions(+), 70 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts index 796f5640570..deaa1c7fe7e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/images.e2e-spec.ts @@ -18,7 +18,7 @@ describe('Images page', () => { after(() => { // Deletes images test pool pools.navigateTo(); - pools.delete(poolName, null, null, true); + pools.delete(poolName, null, null, true, false, false, true); pools.navigateTo(); pools.existTableCell(poolName, false); }); @@ -58,7 +58,7 @@ describe('Images page', () => { }); it('should delete image', () => { - images.delete(newImageName, null, null, true); + images.delete(newImageName, null, null, true, false, false, true); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts index 810ecd27dcc..cb7bad51e58 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/block/mirroring.e2e-spec.ts @@ -112,7 +112,7 @@ describe('Mirroring page', () => { afterEach(() => { pools.navigateTo(); - pools.delete(poolName, null, null, true); + pools.delete(poolName, null, null, true, false, false, true); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts index 43ef2d5cd50..70957e4dada 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/hosts.po.ts @@ -65,7 +65,7 @@ export class HostsPageHelper extends PageHelper { } remove(hostname: string) { - super.delete(hostname, this.columnIndex.hostname, 'hosts', true, false, true); + super.delete(hostname, this.columnIndex.hostname, 'hosts', true, false, true, true); } // Add or remove labels on a host, then verify labels in the table diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts index 167c35cb997..78bc68de023 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/cluster/logs.e2e-spec.ts @@ -54,7 +54,7 @@ describe('Logs page', () => { it('should delete pool and check audit logs reacted', () => { pools.navigateTo(); - pools.delete(poolname, null, null, true); + pools.delete(poolname, null, null, true, false, false, true); logs.checkAuditForPoolFunction(poolname, 'delete', hour, minute); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts index 6252fc7e99d..6af9dd842d6 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/common/forms-helper.feature.po.ts @@ -74,6 +74,10 @@ Then('I check the tick box in carbon modal', () => { cy.get('cds-modal input#confirmation_input').click({ force: true }); }); +Then('I confirm the resource {string}', (name: string) => { + cy.get('cds-modal input#resource_name').type(name); +}); + And('I confirm to {string}', (action: string) => { cy.contains('cd-modal button', action).click(); cy.get('cd-modal').should('not.exist'); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature index 289adcc7693..13921249f08 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/filesystems.e2e-spec.feature @@ -26,6 +26,6 @@ Feature: CephFS Management And I select a row "test_cephfs" And I click on "Remove" button from the table actions Then I should see the carbon modal - And I check the tick box in carbon modal + And I confirm the resource "test_cephfs" And I click on "Remove File System" button Then I should not see a row with "test_cephfs" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature index 67f0e10cb00..f2f80e8cc08 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/snapshots.e2e-spec.feature @@ -60,7 +60,7 @@ Feature: CephFS Snapshot Management And I go to the "Subvolumes" tab And I select a row "test_clone" in the expanded row And I click on "Remove" button from the table actions in the expanded row - And I check the tick box in carbon modal + And I confirm the resource "test_clone" And I click on "Remove Subvolume" button Then I wait for "5" seconds And I should not see a row with "test_clone" in the expanded row @@ -71,7 +71,7 @@ Feature: CephFS Snapshot Management And I go to the "Snapshots" tab And I select a row "test_snapshot" in the expanded row And I click on "Remove" button from the table actions in the expanded row - And I check the tick box in carbon modal + And I confirm the resource "test_snapshot" And I click on "Remove Snapshot" button Then I should not see a row with "test_snapshot" in the expanded row @@ -81,7 +81,7 @@ Feature: CephFS Snapshot Management And I go to the "Subvolumes" tab When I select a row "test_subvolume" in the expanded row And I click on "Remove" button from the table actions in the expanded row - And I check the tick box in carbon modal + And I confirm the resource "test_subvolume" And I click on "Remove Subvolume" button Then I should not see a row with "test_subvolume" in the expanded row @@ -90,6 +90,6 @@ Feature: CephFS Snapshot Management And I select a row "test_cephfs" And I click on "Remove" button from the table actions Then I should see the carbon modal - And I check the tick box in carbon modal + And I confirm the resource "test_cephfs" And I click on "Remove File System" button Then I should not see a row with "test_cephfs" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature index cc0835146b7..17fe6baa2d0 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolume-groups.e2e-spec.feature @@ -37,7 +37,7 @@ Feature: CephFS Subvolume Group management And I go to the "Subvolume groups" tab When I select a row "test_subvolume_group" in the expanded row And I click on "Remove" button from the table actions in the expanded row - And I check the tick box in carbon modal + And I confirm the resource "test_subvolume_group" And I click on "Remove subvolume group" button Then I should not see a row with "test_subvolume_group" in the expanded row @@ -46,6 +46,6 @@ Feature: CephFS Subvolume Group management And I select a row "test_cephfs" And I click on "Remove" button from the table actions Then I should see the carbon modal - And I check the tick box in carbon modal + And I confirm the resource "test_cephfs" And I click on "Remove File System" button Then I should not see a row with "test_cephfs_edit" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolumes.e2e-spec.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolumes.e2e-spec.feature index cf3df6e3f30..e79a8c25207 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolumes.e2e-spec.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/filesystems/subvolumes.e2e-spec.feature @@ -37,7 +37,7 @@ Feature: CephFS Subvolume management And I go to the "Subvolumes" tab When I select a row "test_subvolume" in the expanded row And I click on "Remove" button from the table actions in the expanded row - And I check the tick box in carbon modal + And I confirm the resource "test_subvolume" And I click on "Remove Subvolume" button Then I should not see a row with "test_subvolume" in the expanded row @@ -46,6 +46,6 @@ Feature: CephFS Subvolume management And I select a row "test_cephfs" And I click on "Remove" button from the table actions Then I should see the carbon modal - And I check the tick box in carbon modal + And I confirm the resource "test_cephfs" And I click on "Remove File System" button Then I should not see a row with "test_cephfs_edit" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/02-create-cluster-add-host.feature b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/02-create-cluster-add-host.feature index 0c62d576aa5..ba9acdc40b0 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/02-create-cluster-add-host.feature +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/02-create-cluster-add-host.feature @@ -29,7 +29,7 @@ Feature: Cluster expansion host addition When I select a row "" And I click on "Remove" button from the table actions Then I should see the carbon modal - And I check the tick box in carbon modal + And I confirm the resource "" And I click on "Remove Host" button And I should not see a row with "" diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/09-services.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/09-services.e2e-spec.ts index 88b8ab4c9ea..03d4a878518 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/09-services.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/workflow/09-services.e2e-spec.ts @@ -98,6 +98,7 @@ describe('Services page', () => { cy.get('cd-service-details').within(() => { services.checkServiceStatus('snmp-gateway'); }); + services.clickServiceTab('snmp-gateway', 'Daemons'); services.deleteService('snmp-gateway'); }); @@ -111,6 +112,7 @@ describe('Services page', () => { cy.get('cd-service-details').within(() => { services.checkServiceStatus('snmp-gateway'); }); + services.clickServiceTab('snmp-gateway', 'Daemons'); services.deleteService('snmp-gateway'); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts index 85e15be330e..78ef39682ab 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/page-helper.po.ts @@ -334,7 +334,8 @@ export abstract class PageHelper { section?: string, cdsModal = false, isMultiselect = false, - shouldReload = false + shouldReload = false, + confirmInput = false ) { const action: string = section === 'hosts' ? 'remove' : 'delete'; @@ -347,10 +348,14 @@ export abstract class PageHelper { // Convert action to SentenceCase and Confirms deletion const actionUpperCase = action.charAt(0).toUpperCase() + action.slice(1); - cy.get('input[name="confirmation"]').click({ force: true }); + if (confirmInput) { + cy.get('cds-modal input#resource_name').type(name, { force: true }); + } else { + cy.get('[aria-label="confirmation"]').click({ force: true }); + } if (cdsModal) { - cy.get('cds-modal button').contains(actionUpperCase).click(); + cy.get('cds-modal button').contains(actionUpperCase).click({ force: true }); // Wait for modal to close cy.get('cds-modal').should('not.exist'); } else { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts index ba342344af4..eea6ba5de6e 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/pools/pools.e2e-spec.ts @@ -47,7 +47,7 @@ describe('Pools page', () => { }); it('should delete a pool', () => { - pools.delete(poolName, null, null, true); + pools.delete(poolName, null, null, true, false, false, true); }); }); @@ -65,7 +65,7 @@ describe('Pools page', () => { }); it('should delete the pool', () => { - pools.delete(poolName, null, null, true); + pools.delete(poolName, null, null, true, false, false, true); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts index 2a79e8ebab3..c5a8441be5d 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.e2e-spec.ts @@ -28,7 +28,7 @@ describe('RGW buckets page', () => { }); it('should delete bucket', () => { - buckets.delete(bucket_name, null, null, true, true); + buckets.delete(bucket_name, null, null, true, false, false, true); }); it('should create bucket with object locking enabled', () => { @@ -41,7 +41,7 @@ describe('RGW buckets page', () => { buckets.edit(bucket_name, BucketsPageHelper.USERS[1], true); buckets.getDataTables().should('contain.text', BucketsPageHelper.USERS[1]); - buckets.delete(bucket_name, null, null, true, true); + buckets.delete(bucket_name, null, null, true, false, false, true); }); }); @@ -55,7 +55,7 @@ describe('RGW buckets page', () => { buckets.create(bucket_name, BucketsPageHelper.USERS[0]); buckets.testInvalidEdit(bucket_name); buckets.navigateTo(); - buckets.delete(bucket_name, null, null, true, true); + buckets.delete(bucket_name, null, null, true, false, false, true); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts index 86dbe5c8a40..ade9158ca84 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/buckets.po.ts @@ -12,8 +12,8 @@ export class BucketsPageHelper extends PageHelper { pages = pages; columnIndex = { - name: 3, - owner: 4 + name: 2, + owner: 3 }; versioningStateEnabled = 'Enabled'; @@ -51,7 +51,7 @@ export class BucketsPageHelper extends PageHelper { @PageHelper.restrictTo(pages.index.url) edit(name: string, new_owner: string, isLocking = false) { - this.navigateEdit(name, false, false, null, true); + this.navigateEdit(name, false, false, null); // Placement target is not allowed to be edited and should be hidden cy.get('input[name=placement-target]').should('not.exist'); @@ -107,7 +107,7 @@ export class BucketsPageHelper extends PageHelper { cy.get('@versioningValueCell').should('have.text', this.versioningStateEnabled); // Disable versioning: - this.navigateEdit(name, false, true, null, true); + this.navigateEdit(name, false, true, null); cy.get('label[for=versioning_input]').click(); cy.get('input[name=versioning]').should('not.be.checked'); @@ -167,7 +167,7 @@ export class BucketsPageHelper extends PageHelper { } testInvalidEdit(name: string) { - this.navigateEdit(name, false, true, null, true); + this.navigateEdit(name, false, true, null); cy.get('input[name=versioning]').should('exist').and('not.be.checked'); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.e2e-spec.ts index d1e4836aeb1..3cb1224fb04 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.e2e-spec.ts @@ -25,7 +25,7 @@ describe('RGW configuration page', () => { describe('create and edit encryption configuration', () => { it('should create configuration', () => { configurations.create('vault', 'agent', 'transit', 'https://localhost:8080'); - configurations.getFirstTableCell('SSE_KMS').should('exist'); + configurations.getFirstTableCell('kms').should('exist'); }); it('should edit configuration', () => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.po.ts index 871c94d98a6..cc49804d9fa 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/configuration.po.ts @@ -14,22 +14,22 @@ export class ConfigurationPageHelper extends PageHelper { this.selectKmsProvider(provider); cy.get('#kms_provider').should('have.class', 'ng-valid'); this.selectAuthMethod(auth_method); - cy.get('#auth_method').should('have.class', 'ng-valid'); + cy.get('#auth').should('have.class', 'ng-valid'); this.selectSecretEngine(secret_engine); cy.get('#secret_engine').should('have.class', 'ng-valid'); - cy.get('#address').type(address); - cy.get('#address').should('have.value', address); - cy.get('#address').should('have.class', 'ng-valid'); + cy.get('#addr').type(address); + cy.get('#addr').should('have.value', address); + cy.get('#addr').should('have.class', 'ng-valid'); cy.contains('button', 'Submit').click(); cy.wait(500); cy.get('cd-table').should('exist'); - this.getFirstTableCell('SSE_KMS').should('exist'); + this.getFirstTableCell('kms').should('exist'); } edit(new_address: string) { - this.navigateEdit('SSE_KMS', true, false); - cy.get('#address').clear().type(new_address); - cy.get('#address').should('have.class', 'ng-valid'); + this.navigateEdit('kms', true, false); + cy.get('#addr').clear().type(new_address); + cy.get('#addr').should('have.class', 'ng-valid'); cy.get('#kms_provider').should('be.disabled'); cy.contains('button', 'Submit').click(); this.getFirstTableCell(new_address); @@ -40,7 +40,7 @@ export class ConfigurationPageHelper extends PageHelper { } private selectAuthMethod(auth_method: string) { - return this.selectOption('auth_method', auth_method); + return this.selectOption('auth', auth_method); } private selectSecretEngine(secret_engine: string) { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.e2e-spec.ts index 69b72a5a6b8..396231b52b5 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.e2e-spec.ts @@ -29,7 +29,7 @@ describe('RGW users page', () => { }); it('should delete user', () => { - users.delete(user_name, null, null, true, true); + users.delete(user_name, null, null, true, false, false, true); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts index 59062088a24..c2bc0bf5ff8 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/rgw/users.po.ts @@ -34,7 +34,7 @@ export class UsersPageHelper extends PageHelper { @PageHelper.restrictTo(pages.index.url) edit(name: string, new_fullname: string, new_email: string, new_maxbuckets: string) { - this.navigateEdit(name, false, true, null, true); + this.navigateEdit(name, false, true, null); // Change the full name field cy.get('input#display_name').click().clear({ force: true }).type(new_fullname, { force: true }); @@ -111,7 +111,7 @@ export class UsersPageHelper extends PageHelper { .should('have.text', 'The entered value must be >= 1.'); this.navigateTo(); - this.delete(tenant + '$' + uname, null, null, true, true); + this.delete(tenant + '$' + uname, null, null, true, false, false, true); } invalidEdit() { @@ -121,7 +121,7 @@ export class UsersPageHelper extends PageHelper { this.navigateTo('create'); this.create(tenant, uname, 'xxx', 'xxx@xxx', '50'); const name = tenant + '$' + uname; - this.navigateEdit(name, false, true, null, true); + this.navigateEdit(name, false, true, null); // put invalid email to make field invalid cy.get('#email') @@ -153,6 +153,6 @@ export class UsersPageHelper extends PageHelper { .should('have.text', 'The entered value must be >= 1.'); this.navigateTo(); - this.delete(tenant + '$' + uname, null, null, true, true); + this.delete(tenant + '$' + uname, null, null, true, false, false, true); } } diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts index 8112b89744f..3a85d3f5b74 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/notification.e2e-spec.ts @@ -16,7 +16,7 @@ describe('Notification page', () => { after(() => { cy.login(); pools.navigateTo(); - pools.delete(poolName, null, null, true, false, true); + pools.delete(poolName, null, null, true, false, true, true); }); beforeEach(() => { diff --git a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.e2e-spec.ts b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.e2e-spec.ts index c7c105078f5..347f36bf12c 100644 --- a/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.e2e-spec.ts +++ b/src/pybind/mgr/dashboard/frontend/cypress/e2e/ui/user-mgmt.e2e-spec.ts @@ -30,7 +30,7 @@ describe('User Management page', () => { }); it('should delete a user', () => { - userMgmt.delete(user_name, null, null, true); + userMgmt.delete(user_name, null, null, true, false, false, true); }); }); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html index 122084410f3..a56877512f9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html @@ -8,7 +8,7 @@ Yes, I am sure. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.spec.ts index ce376c93832..f0425114291 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.spec.ts @@ -5,8 +5,7 @@ import { Component, EventEmitter } from '@angular/core'; import { ComboBoxItem } from '../models/combo-box.model'; @Component({ - template: `
`, + template: `
` }) class MockComponent { items: ComboBoxItem[] = [{ content: 'Item1', name: 'Item1' }]; @@ -16,18 +15,15 @@ class MockComponent { } describe('DynamicInputComboboxDirective', () => { - - let component: MockComponent; let fixture: ComponentFixture; let directive: DynamicInputComboboxDirective; beforeEach(() => { TestBed.configureTestingModule({ - declarations: [DynamicInputComboboxDirective, MockComponent], + declarations: [DynamicInputComboboxDirective, MockComponent] }).compileComponents(); fixture = TestBed.createComponent(MockComponent); - component = fixture.componentInstance; directive = fixture.debugElement.children[0].injector.get(DynamicInputComboboxDirective); fixture.detectChanges(); @@ -50,11 +46,13 @@ describe('DynamicInputComboboxDirective', () => { })); it('should not unselect selected items', fakeAsync(() => { - const selectedItems: ComboBoxItem[] = [{ - content: 'selectedItem', - name: 'selectedItem', - selected: true - }]; + const selectedItems: ComboBoxItem[] = [ + { + content: 'selectedItem', + name: 'selectedItem', + selected: true + } + ]; directive.items = selectedItems; @@ -66,5 +64,5 @@ describe('DynamicInputComboboxDirective', () => { expect(directive.items[0].content).toBe(selectedItems[0].content); expect(directive.items[0].selected).toBeTruthy(); - })) + })); }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.ts index 2645e466ec6..54f8ce09342 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dynamic-input-combobox.directive.ts @@ -38,10 +38,7 @@ export class DynamicInputComboboxDirective implements OnInit, OnDestroy { ngOnInit() { this.searchSubscription = this.searchSubject - .pipe( - debounceTime(DEBOUNCE_TIMER), - distinctUntilChanged() - ) + .pipe(debounceTime(DEBOUNCE_TIMER), distinctUntilChanged()) .subscribe((searchString) => { // Already selected items should be selected in the dropdown // even if the items are updated again @@ -52,15 +49,13 @@ export class DynamicInputComboboxDirective implements OnInit, OnDestroy { return { ...item, selected }; }); - const exists = this.items.some( - (item: ComboBoxItem) => item.content === searchString - ); + const exists = this.items.some((item: ComboBoxItem) => item.content === searchString); - if (!exists) { - this.items = this.items.concat({ content: searchString, name: searchString }); - } - this.updatedItems.emit(this.items); - this.combBoxService.emit({ searchString }); + if (!exists) { + this.items = this.items.concat({ content: searchString, name: searchString }); + } + this.updatedItems.emit(this.items); + this.combBoxService.emit({ searchString }); }); } -- 2.39.5