Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(Text): Add demo and integration test
- Loading branch information
1 parent
3b5f0f1
commit 6b42986
Showing
6 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/patternfly-4/react-core/src/components/Text/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { TextContent } from './TextContent'; | ||
export { Text, TextVariants } from './Text'; | ||
export { TextList, TextListVariants } from './TextList'; | ||
export { TextListItem, TextListItemVariants } from './TextListItem'; | ||
export * from './TextContent'; | ||
export * from './Text'; | ||
export * from './TextList'; | ||
export * from './TextListItem'; |
19 changes: 19 additions & 0 deletions
19
packages/patternfly-4/react-integration/cypress/integration/text.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
describe('Text Demo Test', () => { | ||
it('Navigate to demo section', () => { | ||
cy.visit('http://localhost:3000/'); | ||
cy.get('#text-demo-nav-item-link').click(); | ||
cy.url().should('eq', 'http://localhost:3000/text-demo-nav-link') | ||
}); | ||
|
||
it('Verify header text and text content', () => { | ||
cy.get('.pf-c-content h1').contains('Header text'); | ||
}); | ||
|
||
it('Verify text list and text content', () => { | ||
cy.get('.pf-c-content ul').contains('li'); | ||
}); | ||
|
||
it('Verify text list item and text content', () => { | ||
cy.get('.pf-c-content li').contains('Text list item'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ges/patternfly-4/react-integration/demo-app-ts/src/components/demos/TextDemo/TextDemo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Text, TextProps, TextVariants, TextContent, TextList, TextListProps, TextListVariants, TextListItem, TextListItemProps, TextListItemVariants } from '@patternfly/react-core'; | ||
import React, { Component } from 'react'; | ||
export class TextDemo extends Component { | ||
myTextProps: TextProps = { | ||
component: TextVariants.h1, | ||
children: 'Header text' | ||
} | ||
myTextListProps: TextListProps = { | ||
component: TextListItemVariants.ul | ||
} | ||
myTextListItemProps: TextListItemProps = { | ||
component: TextListItemVariants.li, | ||
children: 'Text list item' | ||
} | ||
|
||
render() { | ||
return ( | ||
<TextContent> | ||
<Text component={this.myTextProps.component}>{this.myTextProps.children}</Text> | ||
<TextList component={this.myTextListProps.component}> | ||
<TextListItem children={this.myTextListItemProps.children} component={this.myTextListItemProps.component} /> | ||
</TextList> | ||
</TextContent> | ||
); | ||
} | ||
} | ||
|
||
export default TextDemo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters