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

test(carbon-react): add public API snapshot testing #9384

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
209 changes: 209 additions & 0 deletions packages/carbon-react/__tests__/index-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import * as Carbon from '../src/index';

describe('Carbon Components React', () => {
it('can be imported using the correct path', () => {
expect(typeof Carbon).toBe('object');
});

it('should export components', () => {
expect(Object.keys(Carbon).sort()).toMatchInlineSnapshot(`
Array [
"Accordion",
"AccordionItem",
"AccordionSkeleton",
"AspectRatio",
"Breadcrumb",
"BreadcrumbItem",
"BreadcrumbSkeleton",
"Button",
"ButtonSet",
"ButtonSkeleton",
"Checkbox",
"CheckboxSkeleton",
"ClickableTile",
"CodeSnippet",
"CodeSnippetSkeleton",
"Column",
"ComboBox",
"ComposedModal",
"Content",
"ContentSwitcher",
"Copy",
"CopyButton",
"DangerButton",
"DataTable",
"DataTableSkeleton",
"DatePicker",
"DatePickerInput",
"DatePickerSkeleton",
"Dropdown",
"DropdownSkeleton",
"ErrorBoundary",
"ErrorBoundaryContext",
"ExpandableSearch",
"ExpandableTile",
"FileUploader",
"FileUploaderButton",
"FileUploaderDropContainer",
"FileUploaderItem",
"FileUploaderSkeleton",
"Filename",
"FluidForm",
"Form",
"FormGroup",
"FormItem",
"FormLabel",
"Grid",
"Header",
"HeaderContainer",
"HeaderGlobalAction",
"HeaderGlobalBar",
"HeaderMenu",
"HeaderMenuButton",
"HeaderMenuItem",
"HeaderName",
"HeaderNavigation",
"HeaderPanel",
"HeaderSideNavItems",
"IconSkeleton",
"InlineLoading",
"InlineNotification",
"Link",
"ListItem",
"Loading",
"Modal",
"ModalBody",
"ModalFooter",
"ModalHeader",
"MultiSelect",
"NotificationActionButton",
"NotificationButton",
"NotificationTextDetails",
"NumberInput",
"NumberInputSkeleton",
"OrderedList",
"OverflowMenu",
"OverflowMenuItem",
"Pagination",
"PaginationNav",
"PaginationSkeleton",
"PasswordInput",
"PrimaryButton",
"ProgressIndicator",
"ProgressIndicatorSkeleton",
"ProgressStep",
"RadioButton",
"RadioButtonGroup",
"RadioButtonSkeleton",
"RadioTile",
"Row",
"Search",
"SearchFilterButton",
"SearchLayoutButton",
"SearchSkeleton",
"SecondaryButton",
"Select",
"SelectItem",
"SelectItemGroup",
"SelectSkeleton",
"SelectableTile",
"SideNav",
"SideNavDetails",
"SideNavDivider",
"SideNavFooter",
"SideNavHeader",
"SideNavIcon",
"SideNavItem",
"SideNavItems",
"SideNavLink",
"SideNavLinkText",
"SideNavMenu",
"SideNavMenuItem",
"SideNavSwitcher",
"SkeletonPlaceholder",
"SkeletonText",
"SkipToContent",
"Slider",
"SliderSkeleton",
"StructuredListBody",
"StructuredListCell",
"StructuredListHead",
"StructuredListInput",
"StructuredListRow",
"StructuredListSkeleton",
"StructuredListWrapper",
"Switch",
"Switcher",
"SwitcherDivider",
"SwitcherItem",
"Tab",
"TabContent",
"Table",
"TableActionList",
"TableBatchAction",
"TableBatchActions",
"TableBody",
"TableCell",
"TableContainer",
"TableExpandHeader",
"TableExpandRow",
"TableExpandedRow",
"TableHead",
"TableHeader",
"TableRow",
"TableSelectAll",
"TableSelectRow",
"TableToolbar",
"TableToolbarAction",
"TableToolbarContent",
"TableToolbarMenu",
"TableToolbarSearch",
"Tabs",
"TabsSkeleton",
"Tag",
"TagSkeleton",
"TextArea",
"TextAreaSkeleton",
"TextInput",
"TextInputSkeleton",
"Theme",
"Tile",
"TileAboveTheFoldContent",
"TileBelowTheFoldContent",
"TileGroup",
"TimePicker",
"TimePickerSelect",
"ToastNotification",
"Toggle",
"ToggleSkeleton",
"ToggleSmall",
"ToggleSmallSkeleton",
"Toolbar",
"ToolbarDivider",
"ToolbarItem",
"ToolbarOption",
"ToolbarSearch",
"ToolbarTitle",
"Tooltip",
"TooltipDefinition",
"TooltipIcon",
"UnorderedList",
"unstable_Heading",
"unstable_PageSelector",
"unstable_Pagination",
"unstable_ProgressBar",
"unstable_Section",
"unstable_TreeNode",
"unstable_TreeView",
"useTheme",
]
`);
});
});
18 changes: 11 additions & 7 deletions packages/carbon-react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export {
RadioButton,
RadioButtonGroup,
Search,
ExpandableSearch,
SearchFilterButton,
SearchLayoutButton,
SecondaryButton,
Expand All @@ -106,6 +107,7 @@ export {
Tag,
TextArea,
TextInput,
PasswordInput,
Tile,
ClickableTile,
SelectableTile,
Expand Down Expand Up @@ -184,17 +186,11 @@ export {
SideNavMenuItem,
SideNavSwitcher,
// Experimental
unstable_ProgressBar,
unstable_PageSelector,
unstable_Pagination,
unstable_TreeView,
unstable_TreeNode,
unstable_ContextMenu,
unstable_ContextMenuDivider,
unstable_ContextMenuGroup,
unstable_ContextMenuItem,
unstable_ContextMenuRadioGroup,
unstable_ContextMenuSelectableItem,
unstable_useContextMenu,
unstable_Heading,
unstable_Section,
} from 'carbon-components-react';
Expand All @@ -206,3 +202,11 @@ export {
} from './components/Grid';

export { Theme, useTheme } from './components/Theme';

// unstable_ContextMenu,
// unstable_ContextMenuDivider,
// unstable_ContextMenuGroup,
// unstable_ContextMenuItem,
// unstable_ContextMenuRadioGroup,
// unstable_ContextMenuSelectableItem,
// unstable_useContextMenu,