Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions cypress/component/Ansible.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { Ansible } from '@patternfly/react-component-groups/dist/dynamic/Ansible';

describe('Ansible', () => {
it('renders supported Ansible', () => {
cy.mount(<Ansible />)
cy.get('i').should('have.class', 'ansibleSupported-0-2-2');
});
it('renders unsupported Ansible', () => {
cy.mount(<Ansible isSupported={false}/>)
cy.get('i').should('have.class', 'ansibleUnsupported-0-2-3');
});
});
13 changes: 0 additions & 13 deletions cypress/component/AnsibleSupport.cy.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ section: Component groups
subsection: Status and state indicators
# Sidenav secondary level section
# should be the same for all markdown files
id: Ansible support
id: Ansible
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react
# If you use typescript, the name of the interface to display props for
# These are found through the sourceProps function provided in patternfly-docs.source.js
propComponents: ['AnsibleSupport']
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/AnsibleSupport/AnsibleSupport.md
propComponents: ['Ansible']
sourceLink: https://github.com/patternfly/react-component-groups/blob/main/packages/module/patternfly-docs/content/extensions/component-groups/examples/Ansible/Ansible.md
---

import AnsibleSupport from '@patternfly/react-component-groups/dist/dynamic/AnsibleSupport';
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';

The **Ansible support** component displays the Ansible project logo, with a support status style.
The **Ansible** component displays the Ansible project logo, with a support status style.

### Ansible supported

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import React from 'react';
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';

export const BasicExample: React.FunctionComponent = () => <Ansible />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import React from 'react';
import Ansible from '@patternfly/react-component-groups/dist/dynamic/Ansible';

export const BasicExample: React.FunctionComponent = () => <Ansible isSupported={false} />;

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { render } from '@testing-library/react';
import AnsibleSupport from './AnsibleSupport';
import Ansible from './Ansible';

describe('AnsibleSupport component', () => {
describe('Ansible component', () => {

it('should render unsupported', () => {
const { container } = render(<AnsibleSupport isSupported={false} />);
const { container } = render(<Ansible isSupported={false} />);
expect(container).toMatchSnapshot();
});

it('should render supported', () => {
const { container } = render(<AnsibleSupport />);
const { container } = render(<Ansible />);
expect(container).toMatchSnapshot();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import clsx from 'clsx';
import { createUseStyles } from 'react-jss';

export interface AnsibleSupportProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
export interface AnsibleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
/** Supported/unsupported variant flag */
isSupported?: boolean;
/** Ansible icon className */
Expand Down Expand Up @@ -32,7 +32,7 @@ const useStyles = createUseStyles({
}
})

export const AnsibleSupport: React.FunctionComponent<AnsibleSupportProps> = ({ isSupported = true, className, ouiaId = "AnsibleSupport-icon", ...props }: AnsibleSupportProps) => {
export const Ansible: React.FunctionComponent<AnsibleProps> = ({ isSupported = true, className, ouiaId = "AnsibleSupport-icon", ...props }: AnsibleProps) => {
const classes = useStyles();
const ansibleLogoClass = clsx(
classes.ansible,
Expand Down Expand Up @@ -94,4 +94,4 @@ export const AnsibleSupport: React.FunctionComponent<AnsibleSupportProps> = ({ i
);
};

export default AnsibleSupport;
export default Ansible;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`AnsibleSupport component should render supported 1`] = `
exports[`Ansible component should render supported 1`] = `
<div>
<i
class="ansible-0-2-1 ansibleSupported-0-2-2"
Expand All @@ -26,7 +26,7 @@ exports[`AnsibleSupport component should render supported 1`] = `
</div>
`;

exports[`AnsibleSupport component should render unsupported 1`] = `
exports[`Ansible component should render unsupported 1`] = `
<div>
<i
class="ansible-0-2-1 ansibleUnsupported-0-2-3"
Expand Down
2 changes: 2 additions & 0 deletions packages/module/src/Ansible/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './Ansible';
export * from './Ansible';
2 changes: 0 additions & 2 deletions packages/module/src/AnsibleSupport/index.ts

This file was deleted.