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

Additionally export TeslaS icon as NACS #18

Merged
merged 2 commits into from
May 30, 2023
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
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};