Skip to content

Commit

Permalink
Merge pull request #18 from binary-butterfly/nacs
Browse files Browse the repository at this point in the history
Additionally export TeslaS icon as NACS
  • Loading branch information
DysphoricUnicorn committed May 30, 2023
2 parents 5d76f33 + f094f24 commit 01d8f6d
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The following components are available:
* `<IEC62196T1Combo/>`
* `<IEC62196T2/>`
* `<IEC62196T2Combo/>`
* `<TeslaS/>`
* `<TeslaS/> (also exported as <NACS/>`

All icons are available in solid and light variants as well as with- and without subtitles.

Expand Down
260 changes: 260 additions & 0 deletions __tests__/__snapshots__/main.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,71 @@ exports[`react-charging-station-connector-icons Can render a light non subtitled
}
`;

exports[`react-charging-station-connector-icons Can render a light non subtitled NACS icon 1`] = `
{
"asFragment": [Function],
"baseElement": <body>
<div>
<span />
</div>
</body>,
"container": <div>
<span />
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;

exports[`react-charging-station-connector-icons Can render a light non subtitled TeslaS icon 1`] = `
{
"asFragment": [Function],
Expand Down Expand Up @@ -1105,6 +1170,71 @@ exports[`react-charging-station-connector-icons Can render a light subtitled IEC
}
`;

exports[`react-charging-station-connector-icons Can render a light subtitled NACS icon 1`] = `
{
"asFragment": [Function],
"baseElement": <body>
<div>
<span />
</div>
</body>,
"container": <div>
<span />
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;

exports[`react-charging-station-connector-icons Can render a light subtitled TeslaS icon 1`] = `
{
"asFragment": [Function],
Expand Down Expand Up @@ -1690,6 +1820,71 @@ exports[`react-charging-station-connector-icons Can render a solid non subtitled
}
`;

exports[`react-charging-station-connector-icons Can render a solid non subtitled NACS icon 1`] = `
{
"asFragment": [Function],
"baseElement": <body>
<div>
<span />
</div>
</body>,
"container": <div>
<span />
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;

exports[`react-charging-station-connector-icons Can render a solid non subtitled TeslaS icon 1`] = `
{
"asFragment": [Function],
Expand Down Expand Up @@ -2275,6 +2470,71 @@ exports[`react-charging-station-connector-icons Can render a solid subtitled IEC
}
`;

exports[`react-charging-station-connector-icons Can render a solid subtitled NACS icon 1`] = `
{
"asFragment": [Function],
"baseElement": <body>
<div>
<span />
</div>
</body>,
"container": <div>
<span />
</div>,
"debug": [Function],
"findAllByAltText": [Function],
"findAllByDisplayValue": [Function],
"findAllByLabelText": [Function],
"findAllByPlaceholderText": [Function],
"findAllByRole": [Function],
"findAllByTestId": [Function],
"findAllByText": [Function],
"findAllByTitle": [Function],
"findByAltText": [Function],
"findByDisplayValue": [Function],
"findByLabelText": [Function],
"findByPlaceholderText": [Function],
"findByRole": [Function],
"findByTestId": [Function],
"findByText": [Function],
"findByTitle": [Function],
"getAllByAltText": [Function],
"getAllByDisplayValue": [Function],
"getAllByLabelText": [Function],
"getAllByPlaceholderText": [Function],
"getAllByRole": [Function],
"getAllByTestId": [Function],
"getAllByText": [Function],
"getAllByTitle": [Function],
"getByAltText": [Function],
"getByDisplayValue": [Function],
"getByLabelText": [Function],
"getByPlaceholderText": [Function],
"getByRole": [Function],
"getByTestId": [Function],
"getByText": [Function],
"getByTitle": [Function],
"queryAllByAltText": [Function],
"queryAllByDisplayValue": [Function],
"queryAllByLabelText": [Function],
"queryAllByPlaceholderText": [Function],
"queryAllByRole": [Function],
"queryAllByTestId": [Function],
"queryAllByText": [Function],
"queryAllByTitle": [Function],
"queryByAltText": [Function],
"queryByDisplayValue": [Function],
"queryByLabelText": [Function],
"queryByPlaceholderText": [Function],
"queryByRole": [Function],
"queryByTestId": [Function],
"queryByText": [Function],
"queryByTitle": [Function],
"rerender": [Function],
"unmount": [Function],
}
`;

exports[`react-charging-station-connector-icons Can render a solid subtitled TeslaS icon 1`] = `
{
"asFragment": [Function],
Expand Down
21 changes: 21 additions & 0 deletions __tests__/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
IEC62196T1Combo,
IEC62196T2,
IEC62196T2Combo,
NACS,
TeslaS,
} from '../src/main';
import {render} from '@testing-library/react';
Expand Down Expand Up @@ -193,6 +194,26 @@ describe('react-charging-station-connector-icons', () => {
expect(rendered).toMatchSnapshot();
});

it('Can render a light non subtitled NACS icon', () => {
const rendered = render(<NACS variant="light" subtitled={false}/>);
expect(rendered).toMatchSnapshot();
});

it('Can render a light subtitled NACS icon', () => {
const rendered = render(<NACS variant="light" subtitled={true}/>);
expect(rendered).toMatchSnapshot();
});

it('Can render a solid non subtitled NACS icon', () => {
const rendered = render(<NACS variant="solid" subtitled={false}/>);
expect(rendered).toMatchSnapshot();
});

it('Can render a solid subtitled NACS icon', () => {
const rendered = render(<NACS variant="solid" subtitled={true}/>);
expect(rendered).toMatchSnapshot();
});

it('Throws an error for unknown variants', () => {
const spy = jest.spyOn(global.console, 'error').mockImplementation(() => null);
const testFunc = () => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-charging-station-connector-icons",
"version": "1.0.3",
"version": "1.1.0",
"license": "CC0-1.0",
"private": false,
"main": "dist/umd/react-charging-station-connector-icons.js",
Expand Down
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ export const TeslaS = (props: IconProps) => {
light: {default: TeslaSLightIcon, subtitled: TeslaSLightSubtitledIcon},
}, props, props.variant, props.subtitled);
};

export {TeslaS as NACS};

0 comments on commit 01d8f6d

Please sign in to comment.