Skip to content

Commit

Permalink
Updated failing cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Aug 14, 2024
1 parent f3789b1 commit 108e34b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
4 changes: 2 additions & 2 deletions packages/react-integration/cypress/integration/card.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ describe('Card Demo Test', () => {
});

it('Verify clickable only card action is triggered', () => {
cy.get('#clickable-card-drawer').should('not.have.class', 'pf-m-expanded');
cy.get('#clickable-card-example-1').should('not.have.class', 'pf-m-current');
cy.get('#clickable-card-example-1').click();
cy.get('#clickable-card-drawer').should('have.class', 'pf-m-expanded');
cy.get('#clickable-card-example-1').should('have.class', 'pf-m-current');
});

it('Verify clickable only card link is navigated to', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface CardDemoState {
selectableChecked1: boolean;
selectableChecked2: boolean;
singleSelectableChecked: string;
drawerIsExpanded: boolean;
isCardClicked: boolean;
selectableClickableChecked: boolean;
selectableClickableSelected: boolean;
selectaleClickableDrawerIsExpanded: boolean;
Expand All @@ -44,7 +44,7 @@ class CardDemo extends Component {
selectableChecked1: false,
selectableChecked2: false,
singleSelectableChecked: '',
drawerIsExpanded: false,
isCardClicked: false,
selectableClickableChecked: false,
selectableClickableSelected: false,
selectaleClickableDrawerIsExpanded: false
Expand Down Expand Up @@ -117,7 +117,7 @@ class CardDemo extends Component {
selectableChecked1,
selectableChecked2,
singleSelectableChecked,
drawerIsExpanded,
isCardClicked,
selectableClickableChecked,
selectableClickableSelected,
selectaleClickableDrawerIsExpanded
Expand Down Expand Up @@ -259,35 +259,21 @@ class CardDemo extends Component {
<CardBody>This card is single selectable.</CardBody>
</Card>
<br></br>
<div style={{ height: '150px' }}>
<Drawer id="clickable-card-drawer" isExpanded={drawerIsExpanded}>
<DrawerContent
panelContent={
<DrawerPanelContent>
<span>Clickable card drawer panel</span>
</DrawerPanelContent>
}
>
<DrawerContentBody>
<Card id="clickable-card-example-1" isClickable>
<CardHeader
selectableActions={{
onClickAction: () => {
this.setState({ drawerIsExpanded: !drawerIsExpanded });
},
selectableActionId: 'clickable-card-input-1',
selectableActionAriaLabelledby: 'clickable-card-example-1',
name: 'clickable-card-example-1'
}}
>
<CardTitle>Clickable card with action</CardTitle>
</CardHeader>
<CardBody>This card performs an action on click.</CardBody>
</Card>
</DrawerContentBody>
</DrawerContent>
</Drawer>
</div>
<Card id="clickable-card-example-1" isClickable isClicked={isCardClicked}>
<CardHeader
selectableActions={{
onClickAction: () => {
this.setState({ isCardClicked: !isCardClicked });
},
selectableActionId: 'clickable-card-input-1',
selectableActionAriaLabelledby: 'clickable-card-example-1',
name: 'clickable-card-example-1'
}}
>
<CardTitle>Clickable card with action</CardTitle>
</CardHeader>
<CardBody>This card performs an action on click.</CardBody>
</Card>
<br></br>
<Card id="clickable-card-example-2" isClickable>
<CardHeader
Expand Down

0 comments on commit 108e34b

Please sign in to comment.