Skip to content

Commit

Permalink
ROX-19193: Update incorrect form behavior for delegated scanning (sta…
Browse files Browse the repository at this point in the history
  • Loading branch information
vjwilson authored Aug 24, 2023
1 parent 9a58b34 commit 705884f
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ describe('Delegated Image Scanning', () => {
cy.get('.pf-c-breadcrumb__item:contains("Delegated Image Scanning")');

// check the initial state of the delegate config
getInputByLabel('Enable delegated image scanning').should('not.be.checked');
getInputByLabel('None').should('be.checked');

cy.get('label:contains("All registries")').should('not.be.exist');
cy.get('label:contains("Specified registries")').should('not.be.exist');
cy.get('label:contains("All registries")').should('not.be.checked');
cy.get('label:contains("Specified registries")').should('not.be.checked');

// Enable delegate scanning with default
getInputByLabel('Enable delegated image scanning').click();
getInputByLabel('All registries').click();

getInputByLabel('All registries').should('be.checked');
getInputByLabel('Specified registries').should('not.be.checked');
Expand All @@ -54,6 +54,9 @@ describe('Delegated Image Scanning', () => {
getInputByLabel('All registries').should('not.be.checked');
getInputByLabel('Specified registries').should('be.checked');

// None shoudl be value for default cluster
cy.get('.cluster-select').should('have.text', 'None').should('have.value', '');

// choose the first cluster in the list as the default
cy.get('.cluster-select').click();
cy.get('.cluster-select .pf-c-select__menu .pf-c-select__menu-item').then(
Expand All @@ -62,21 +65,22 @@ describe('Delegated Image Scanning', () => {
}
);
cy.get('.cluster-select .pf-c-select__menu .pf-c-select__menu-item')
.first()
.then(($firstCluster) => {
const firstClusterName = $firstCluster.text();
.last()
.then(($lastCluster) => {
const lastClusterName = $lastCluster.text();
cy.log('lastClusterName', lastClusterName);

$firstCluster.click();
$lastCluster.click();

cy.get('.cluster-select').should('have.text', firstClusterName);
});
cy.get('.cluster-select').should('have.text', lastClusterName);

// save the configuration
saveDelegatedRegistryConfig();
// save the configuration
saveDelegatedRegistryConfig();

cy.get(
'.pf-c-alert.pf-m-success .pf-c-alert__title:contains("Delegated scanning configuration saved successfully")'
);
cy.get(
'.pf-c-alert.pf-m-success .pf-c-alert__title:contains("Delegated scanning configuration saved successfully")'
);
});
});

describe('when user does not have permission to see page', () => {
Expand Down
Loading

0 comments on commit 705884f

Please sign in to comment.