Skip to content

Commit

Permalink
Deprecate follow up (#10850)
Browse files Browse the repository at this point in the history
* fix(Table deprecated):  Fix editable select row to close menu when click outside

* more updates

* re-enabled Page nd toolbar testd

* update demos

* fix typescript errors

* fix integration tests

* fix and reneable form integration test

* add placeholder prop

* make prop isPlaceholder optional in onSelect
  • Loading branch information
tlabaj authored Sep 20, 2024
1 parent 7eb9dfa commit 046e371
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 103 deletions.
12 changes: 6 additions & 6 deletions packages/react-integration/cypress/integration/form.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xdescribe('Form Demo Test', () => {
describe('Form Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/form-demo-nav-link');
});
Expand Down Expand Up @@ -70,21 +70,21 @@ xdescribe('Form Demo Test', () => {
});

it('Verify keypress can control the multi-select-typeahead', () => {
cy.get('[id*="pf-select-toggle-id"][id*="select-multi-typeahead-typeahead"]').type('{downarrow}{downarrow}{enter}');
cy.get('.pf-v6-c-menu-toggle').type('{downarrow}{downarrow}{enter}');
cy.get('.pf-v6-c-label__text').should('exist').and('have.text', 'Florida');

cy.get('.pf-v6-c-label button').click();

cy.get('[id*="pf-select-toggle-id"][id*="select-multi-typeahead-typeahead"]').type('New J');
cy.get('.pf-v6-c-text-input-group__text-input').click().type('New J');

cy.get('.pf-v6-c-select__menu-item').should('exist').and('have.text', 'New Jersey');
cy.get('.pf-v6-c-menu__item').should('exist').and('have.text', 'New Jersey');
cy.focused().type('{backspace}{backspace}{backspace}{backspace}orth');
cy.get('.pf-v6-c-select__menu-item').should('exist').and('have.text', 'North Carolina');
cy.get('.pf-v6-c-menu__item').should('exist').and('have.text', 'North Carolina');
cy.focused().type('{backspace}{backspace}{backspace}{backspace}{backspace}');

// @ts-ignore
cy.tab();
cy.get('.pf-v6-c-select__menu-item').should('not.exist');
cy.get('.pf-v6-c-menu__item').should('not.exist');
});

it('Verify pressing spacebar selects the checkbox component', () => {
Expand Down
8 changes: 5 additions & 3 deletions packages/react-integration/cypress/integration/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Page Demo Test', () => {
cy.visit('http://localhost:3000/page-demo-nav-link');
});

xit('Test Page elements', () => {
it('Test Page elements', () => {
cy.get('#page-demo').within(() => {
cy.get('#nav-toggle').then((hamburgerIcon: JQuery<HTMLDivElement>) => {
cy.get('.pf-v6-c-page__sidebar.pf-m-expanded').should('exist');
Expand All @@ -12,9 +12,11 @@ describe('Page Demo Test', () => {
cy.get('.pf-v6-c-page__sidebar.pf-m-collapsed').should('exist');
cy.get('.pf-v6-c-page__sidebar.pf-m-expanded').should('not.exist');
});
cy.get('#page-demo-header').should('not.have.attr', 'role');
cy.get('#page-demo-masthead').should('not.have.attr', 'role');
cy.get('#page-demo-page-id').should('not.have.attr', 'role');
cy.get('div[class="pf-v6-c-page__header-brand-link"]').invoke('text').should('eq', "Logo that's a <div>");
cy.get(
'#page-demo-masthead > .pf-v6-c-masthead__main > .pf-v6-c-masthead__brand > .pf-v6-c-masthead__logo'
).should('exist');
cy.get('.pf-v6-c-page__main-section.pf-m-no-padding').should('exist');
cy.get('.pf-v6-c-page__main-section.pf-m-no-padding-on-md').should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xdescribe('Table Simple Test', () => {
describe('Table Simple Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/table-editable-demo-nav-link');
});
Expand All @@ -20,9 +20,9 @@ xdescribe('Table Simple Test', () => {
'.pf-m-inline-editable > [data-label="Text input col 1"] > .pf-v6-c-inline-edit__input > .pf-v6-c-form-control > input'
).type('test');
cy.get(
'.pf-m-inline-editable > [data-label="Dropdown col 5"] > .pf-v6-c-inline-edit__input > .pf-v6-c-select > .pf-v6-c-select__toggle > .pf-v6-c-select__toggle-button'
'.pf-m-inline-editable > [data-label="Dropdown col 5"] > .pf-v6-c-inline-edit__input > .pf-v6-c-menu-toggle > .pf-v6-c-menu-toggle__controls'
).click();
cy.get(':nth-child(4) > .pf-v6-c-check__label').click();
cy.get('#uniqueIdRow1Cell5Option3').click();
cy.get(
'.pf-m-inline-editable > .pf-v6-c-table__inline-edit-action > .pf-v6-c-inline-edit__group > :nth-child(1) > .pf-v6-c-button'
).click();
Expand All @@ -46,9 +46,9 @@ xdescribe('Table Simple Test', () => {
.clear()
.type('xyz');
cy.get(
'.pf-m-inline-editable:nth-of-type(2) > [data-label="Dropdown col 5"] > .pf-v6-c-inline-edit__input > .pf-v6-c-select > .pf-v6-c-select__toggle > .pf-v6-c-select__toggle-button'
'.pf-m-inline-editable > [data-label="Dropdown col 5"] > .pf-v6-c-inline-edit__input > .pf-v6-c-menu-toggle > .pf-v6-c-menu-toggle__controls'
).click();
cy.get('#uniqueIdRow2Cell5Option3 > .pf-v6-c-select__menu-item').click();
cy.get('#uniqueIdRow2Cell5Option3').click();
cy.get(
'.pf-m-inline-editable:nth-of-type(2) > .pf-v6-c-table__inline-edit-action > .pf-v6-c-inline-edit__group > :nth-child(2) > .pf-v6-c-button'
).click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xdescribe('Data Toolbar Demo Test', () => {
describe('Data Toolbar Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/toolbar-demo-nav-link');
});
Expand Down
Loading

0 comments on commit 046e371

Please sign in to comment.