process group cypress tests are passing w/ burnettk

This commit is contained in:
jasquat 2022-11-04 12:20:55 -04:00
parent 8ce7886326
commit e52157fe58
9 changed files with 61 additions and 50 deletions

View File

@ -10,4 +10,9 @@ module.exports = defineConfig({
// implement node event listeners here
},
},
// this scrolls away from the elements for some reason with carbon when set to top
// https://github.com/cypress-io/cypress/issues/2353
// https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Scrolling
scrollBehavior: "center",
});

View File

@ -30,9 +30,9 @@ describe('process-groups', () => {
newGroupDisplayName
);
cy.contains('Delete').click();
cy.contains('Delete Process Group').click();
cy.contains('Are you sure');
cy.contains('OK').click();
cy.getBySel('modal-confirmation-dialog').get('.cds--btn--danger').click();
cy.url().should('include', `process-groups`);
cy.contains(groupId).should('not.exist');
});

View File

@ -101,18 +101,15 @@ Cypress.Commands.add(
);
Cypress.Commands.add('basicPaginationTest', () => {
cy.get('#pagination-page-dropdown')
.type('typing_to_open_dropdown_box....FIXME')
.find('.dropdown-item')
.contains(/^2$/)
.click();
cy.getBySel('pagination-options').scrollIntoView();
cy.get('.cds--select__item-count').find('.cds--select-input').select('2');
cy.contains(/^1-2 of \d+$/);
cy.getBySel('pagination-previous-button-inactive');
cy.getBySel('pagination-next-button').click();
cy.contains(/^3-4 of \d+$/);
cy.getBySel('pagination-previous-button').click();
cy.contains(/^1-2 of \d+$/);
// NOTE: this is a em dash instead of en dash
cy.contains(/\b12 of \d+/);
cy.get('.cds--pagination__button--forward').click();
cy.contains(/\b34 of \d+/);
cy.get('.cds--pagination__button--backward').click();
cy.contains(/\b12 of \d+/);
});
Cypress.Commands.add('assertAtLeastOneItemInPaginatedResults', () => {

12
package-lock.json generated
View File

@ -9193,9 +9193,9 @@
"integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
},
"node_modules/cypress": {
"version": "10.8.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.8.0.tgz",
"integrity": "sha512-QVse0dnLm018hgti2enKMVZR9qbIO488YGX06nH5j3Dg1isL38DwrBtyrax02CANU6y8F4EJUuyW6HJKw1jsFA==",
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.11.0.tgz",
"integrity": "sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
@ -36484,9 +36484,9 @@
"integrity": "sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A=="
},
"cypress": {
"version": "10.8.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.8.0.tgz",
"integrity": "sha512-QVse0dnLm018hgti2enKMVZR9qbIO488YGX06nH5j3Dg1isL38DwrBtyrax02CANU6y8F4EJUuyW6HJKw1jsFA==",
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.11.0.tgz",
"integrity": "sha512-lsaE7dprw5DoXM00skni6W5ElVVLGAdRUUdZjX2dYsGjbY/QnpzWZ95Zom1mkGg0hAaO/QVTZoFVS7Jgr/GUPA==",
"dev": true,
"requires": {
"@cypress/request": "^2.88.10",

View File

@ -26,13 +26,6 @@ export default function ButtonWithConfirmation({
setShowConfirmationPrompt(false);
};
const modalBodyElement = () => {
if (description) {
return <Modal.Body>{description}</Modal.Body>;
}
return null;
};
const handleConfirmation = () => {
onConfirmation();
setShowConfirmationPrompt(false);
@ -43,6 +36,7 @@ export default function ButtonWithConfirmation({
<Modal
open={showConfirmationPrompt}
danger
data-qa="modal-confirmation-dialog"
modalHeading={description}
modalLabel={title}
primaryButtonText={confirmButtonLabel}

View File

@ -56,14 +56,22 @@ export default function NavigationBar() {
return (
<>
<HeaderGlobalAction>{UserService.getUsername()}</HeaderGlobalAction>
<HeaderGlobalAction aria-label="Logout" onClick={handleLogout}>
<HeaderGlobalAction
aria-label="Logout"
onClick={handleLogout}
data-qa="logout-button"
>
<Logout />
</HeaderGlobalAction>
</>
);
}
return (
<HeaderGlobalAction aria-label="Login" onClick={handleLogin}>
<HeaderGlobalAction
data-qa="login-button"
aria-label="Login"
onClick={handleLogin}
>
<Login />
</HeaderGlobalAction>
);

View File

@ -35,10 +35,12 @@ export default function PaginationForTable({
navigate(`${path}?page=${newPage}&per_page=${pageSize}${queryParamString}`);
};
if (pagination) {
return (
<>
{tableToDisplay}
<Pagination
data-qa="pagination-options"
backwardText="Previous page"
forwardText="Next page"
itemsPerPageText="Items per page:"
@ -46,9 +48,11 @@ export default function PaginationForTable({
pageNumberText="Page Number"
pageSize={perPage}
pageSizes={perPageOptions || PER_PAGE_OPTIONS}
totalItems={(pagination as any).total}
totalItems={pagination.total}
onChange={updateRows}
/>
</>
);
}
return null;
}

View File

@ -105,6 +105,7 @@ export default function ProcessGroupForm({
const textInputs = [
<TextInput
id="process-group-display-name"
name="display_name"
invalidText="Display Name is required."
invalid={displayNameInvalid}
labelText="Display Name*"
@ -118,6 +119,7 @@ export default function ProcessGroupForm({
textInputs.push(
<TextInput
id="process-group-identifier"
name="id"
invalidText="Identifier is required and must be all lowercase characters and hyphens."
invalid={identifierInvalid}
labelText="Identifier*"
@ -137,6 +139,7 @@ export default function ProcessGroupForm({
textInputs.push(
<TextInput
id="process-group-description"
name="description"
labelText="Description"
value={processGroup.description}
onChange={(event: any) =>
@ -159,7 +162,7 @@ export default function ProcessGroupForm({
<ButtonWithConfirmation
description={`Delete Process Group ${processGroup.id}?`}
onConfirmation={deleteProcessGroup}
buttonLabel="Delete"
buttonLabel="Delete Process Group"
confirmButtonLabel="Delete"
/>
);

View File

@ -3,11 +3,11 @@ import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import {
Button,
Table,
ExpandableTile,
TileAboveTheFoldContent,
TileBelowTheFoldContent,
TextInput,
ClickableTile,
// ExpandableTile,
// TileAboveTheFoldContent,
// TileBelowTheFoldContent,
// TextInput,
// ClickableTile,
// @ts-ignore
} from '@carbon/react';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';