Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the docs #152

Merged
merged 8 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions cypress/e2e/DataView.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
describe('Test the Data view docs page', () => {

it('displays a layout with a table and paginates', () => {
const ouiaId = 'LayoutExample';
cy.viewport(1400, 2800)

cy.visit('http://localhost:8006/extensions/data-view/layout');
cy.visit('http://localhost:8006/extensions/data-view/data-view');

cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repository');
cy.get(`[data-ouia-component-id="${ouiaId}Header-pagination"]`).should('exist');
cy.get(`[data-ouia-component-id="${ouiaId}Header-bulk-select"]`).should('exist');

cy.get(`[data-ouia-component-id="${ouiaId}Footer-pagination"]`).should('exist');
cy.get(`[data-ouia-component-id="${ouiaId}Footer-bulk-select"]`).should('not.exist');

cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).contains('Repositories');
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).contains('Repository');
cy.get(`[data-ouia-component-id="${ouiaId}-th-4"]`).contains('Last commit');

cy.get(`[data-ouia-component-id="${ouiaId}-td-0-0"]`).contains('Repository one');
Expand All @@ -27,33 +29,33 @@ describe('Test the Data view docs page', () => {
cy.get(`[data-ouia-component-id="${ouiaId}-td-0-4"]`).contains('Timestamp one');

// test bulk select
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('not.be.checked')});
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
.each(($checkbox) => {
cy.wrap($checkbox).should('not.be.checked');
});

// page checkbox select
cy.get(`[data-ouia-component-id="BulkSelect-checkbox"`).first().click();
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
.each(($checkbox) => {
cy.wrap($checkbox).should('be.checked');
});
cy.contains('5 selected').should('exist');

// select none
cy.get(`[data-ouia-component-id="BulkSelect-toggle"`).first().click({ force: true });
cy.get(`[data-ouia-component-id="BulkSelect-select-none"`).first().click();
cy.contains('5 selected').should('not.exist');

// select all
cy.get(`[data-ouia-component-id="BulkSelect-toggle"`).first().click({ force: true });
cy.get(`[data-ouia-component-id="BulkSelect-select-all"`).first().click();
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
cy.contains('6 selected').should('exist');

// page checkbox deselect
cy.get(`[data-ouia-component-id="BulkSelect-checkbox"`).first().click();
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('not.be.checked')});
cy.contains('1 selected').should('exist');
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
.each(($checkbox) => {
cy.wrap($checkbox).should('not.be.checked');
});

// select page
cy.get(`[data-ouia-component-id="BulkSelect-toggle"`).first().click({ force: true });
cy.get(`[data-ouia-component-id="BulkSelect-select-page"`).first().click();
cy.get(`input[type="checkbox"`).each(($checkbox) => {cy.wrap($checkbox).should('be.checked')});
cy.contains('6 selected').should('exist');
cy.get('[data-ouia-component-id="LayoutExample"] input[type="checkbox"]')
.each(($checkbox) => {
cy.wrap($checkbox).should('be.checked');
});
cy.contains('5 selected').should('exist');
})
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ describe('Test the Data view docs page', () => {
it('displays a table and opens detail', () => {
const ouiaId = 'ContextExample';

cy.visit('http://localhost:8006/extensions/data-view/events-context');
cy.visit('http://localhost:8006/extensions/data-view/data-view');

cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).contains('Repositories');
cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repositories');
cy.get(`[data-ouia-component-id="${ouiaId}-th-4"]`).contains('Last commit');

cy.get(`[data-ouia-component-id="${ouiaId}-td-0-0"]`).contains('Repository one');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('Test the Data view docs with tree table', () => {
it('displays a a components page with tree table', () => {
const ouiaId = 'TreeTableExample';

cy.visit('http://localhost:8006/extensions/data-view/components');
cy.visit('http://localhost:8006/extensions/data-view/table');

cy.get(`[data-ouia-component-id="${ouiaId}-th-0"]`).scrollIntoView().contains('Repositories');
cy.get(`[data-ouia-component-id="${ouiaId}-th-1"]`).contains('Branches');
Expand Down
145 changes: 58 additions & 87 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"serve:a11y": "npm run serve:a11y -w @patternfly/react-data-view"
},
"devDependencies": {
"@patternfly/patternfly": "^5.4.0",
"@patternfly/documentation-framework": "5.23.0",
"@patternfly/react-core": "^5.4.0",
"@patternfly/react-icons": "^5.4.0",
"@patternfly/react-table": "^5.4.0",
"@patternfly/patternfly": "^5.4.2",
"@patternfly/documentation-framework": "5.26.1",
"@patternfly/react-core": "^5.4.8",
"@patternfly/react-icons": "^5.4.2",
"@patternfly/react-table": "^5.4.1",
"@patternfly/react-component-groups": "^5.5.1",
"@babel/core": "^7.24.7",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
Expand Down

This file was deleted.

Loading
Loading