diff --git a/src/MultiInput/MultiInput.test.js b/src/MultiInput/MultiInput.test.js
index 90ed36dfb..d41de9ca1 100644
--- a/src/MultiInput/MultiInput.test.js
+++ b/src/MultiInput/MultiInput.test.js
@@ -55,23 +55,23 @@ describe('
', () => {
});
// create a default multi-input control
- test('create multi-input', () => {
+ xtest('create multi-input', () => {
const component = renderer.create(multiInput);
const tree = component.toJSON();
// todo: multi-input uses randon number for some elements which cause snapshot to fail
// todo: work on testing solution
- // expect(tree).toMatchSnapshot();
+ expect(tree).toMatchSnapshot();
});
// create a compact multi-input control
- test('create compact multi-input', () => {
+ xtest('create compact multi-input', () => {
const component = renderer.create(compactMultiInput);
const tree = component.toJSON();
// todo: multi-input uses randon number for some elements which cause snapshot to fail
// todo: work on testing solution
- // expect(tree).toMatchSnapshot();
+ expect(tree).toMatchSnapshot();
});
// check that the tag list is hidden
diff --git a/src/Pagination/Pagination.Component.js b/src/Pagination/Pagination.Component.js
index 7b8a7f75b..99c85c8c7 100644
--- a/src/Pagination/Pagination.Component.js
+++ b/src/Pagination/Pagination.Component.js
@@ -1,114 +1,154 @@
import React from 'react';
-import { DocsTile, DocsText, Separator, Header, Description, Import, Properties, Pagination } from '../';
+import {
+ DocsTile,
+ DocsText,
+ Separator,
+ Header,
+ Description,
+ Import,
+ Properties,
+ Pagination
+} from '../';
export const PaginationComponent = () => {
- const handleClick = event => {
- // console.log(`Page clicked - ${event}`);
- };
- return (
-
-
-
- Pagination is commonly used for tables and tiles. It allows users to see how many pages of content
- exist, to navigate and highlights which page they are currently viewing. This control does not handle
- how many tiles or rows to display in a table. This control simply adds a nice user experience to handle
- how to navigate through a collection. The handling of which items to display needs to be handled in the
- function that is passed in the onClick method of the Pagination control.
-
-
+ const handleClick = event => {
+ alert(`Page clicked - ${event}`);
+ };
+ return (
+
+
+
+ Pagination is commonly used for tables and tiles. It allows users to see
+ how many pages of content exist, to navigate and highlights which page
+ they are currently viewing. This control does not handle how many tiles
+ or rows to display in a table. This control simply adds a nice user
+ experience to handle how to navigate through a collection. The handling
+ of which items to display needs to be handled in the function that is
+ passed in the onClick method of the Pagination control.
+
+
-
+
-
+
-
+
-
First Page
-
When the first page is active, the Back arrow should be disabled.
-
-
-
-
{''}
-
+
First Page
+
+ When the first page is active, the Back arrow should be disabled.
+
+
+
+
+
+ {''}
+
+
-
Last Page
-
When the last page is active, the Next arrow should be disabled.
-
-
-
-
{''}
-
+
Last Page
+
+ When the last page is active, the Next arrow should be disabled.
+
+
+
+
+
+ {''}
+
+
-
Items per Page
-
Set how many items per page.
-
-
-
-
{''}
+
Items per Page
+
Set how many items per page.
+
+
+
+
+ {
+ ''
+ }
+
-
+
-
Set Initial Page
-
Set initial page to be selected
-
-
-
-
{''}
-
+
Set Initial Page
+
Set initial page to be selected
+
+
+
+
+ {''}
+
+
-
Hide Total
-
Only show page numbers, Previous and Next controls
-
-
-
-
{''}
-
+
Hide Total
+
+ Only show page numbers, Previous and Next controls
+
+
+
+
+
+ {
+ ''
+ }
+
+
-
Total Text
-
Customize text to show next to item total
-
-
-
-
- {' '}
- {''}
-
-
-
- );
+
Total Text
+
Customize text to show next to item total
+
+
+
+
+ {' '}
+ {
+ ''
+ }
+
+
+
+ );
};
diff --git a/src/SearchInput/SearchInput.js b/src/SearchInput/SearchInput.js
index 02f56b7bd..33ac1b8d0 100644
--- a/src/SearchInput/SearchInput.js
+++ b/src/SearchInput/SearchInput.js
@@ -1,5 +1,4 @@
import React, { Component } from 'react';
-import PropTypes from 'prop-types';
export class SearchInput extends Component {
constructor(props) {
diff --git a/src/SearchInput/SearchInput.test.js b/src/SearchInput/SearchInput.test.js
index cb7784e87..e59c1a7ba 100644
--- a/src/SearchInput/SearchInput.test.js
+++ b/src/SearchInput/SearchInput.test.js
@@ -135,7 +135,7 @@ describe('
', () => {
expect(wrapper.state('isExpanded')).toBeTruthy();
// enter text into search input
- const itemClicked = wrapper
+ wrapper
.find('.fd-menu__item')
.at(0)
.simulate('click', searchData[0]);
diff --git a/src/Shellbar/Shellbar.test.js b/src/Shellbar/Shellbar.test.js
index 85fcbf234..69dcbe291 100644
--- a/src/Shellbar/Shellbar.test.js
+++ b/src/Shellbar/Shellbar.test.js
@@ -5,169 +5,173 @@ import { Shellbar } from './Shellbar';
import { Menu, MenuList, MenuItem } from '../Menu/Menu';
describe('
', () => {
- const profile1 = {
- initials: 'JS',
- userName: 'John Snow',
- colorAccent: 8
- };
-
- const profileMenu = [
- {
- name: 'Settings',
- glyph: 'action-settings',
- size: 's',
- callback: () => alert('Settings selected!')
- },
- {
- name: 'Sign Out',
- glyph: 'log',
- size: 's',
- callback: () => alert('Sign Out selected!')
- }
- ];
-
- const simpleShellBar = (
-
- }
- productTitle='Corporate Portal'
- profile={profile1}
- profileMenu={profileMenu} />
- );
-
- const simpleShellBarWithClass = (
-
- }
- productTitle='Corporate Portal'
- profile={profile1}
- profileMenu={profileMenu} />
- );
-
- const searchInput = {
- label: 'Search',
- placeholder: 'Enter a fruit',
- onSearch: function(searchTerm) {
- alert(`Search fired for ${searchTerm}`);
- },
- callback: () => alert('Search selected!')
- };
-
- const actions = [
- {
- glyph: 'settings',
- label: 'Settings',
- notificationCount: 5,
- callback: () => alert('Settings selected!'),
- menu: (
-
- )
- }
- ];
-
- const notifications = {
- notificationCount: 2,
- label: 'Notifications',
- notificationsBody: (
-
- ),
- noNotificationsBody: (
-
- ),
- callback: () => alert('Notification selected!')
- };
-
- const profile = {
- initials: 'JS',
- userName: 'John Snow',
- colorAccent: 8
- };
-
- const productMenu = [
- { name: 'Application A', callback: () => alert('Application A selected!') },
- { name: 'Application B', callback: () => alert('Application B selected!') },
- { name: 'Application C', callback: () => alert('Application C selected!') },
- { name: 'Application D', callback: () => alert('Application D selected!') }
- ];
-
- const productSwitcherList = [
- {
- title: 'Fiori Home',
- glyph: 'home',
- callback: () => alert('Fiori Home selected!')
- },
- {
- title: 'S/4 HANA Cloud',
- glyph: 'cloud',
- callback: () => alert('S/4 HANA Cloud selected!')
- }
- ];
-
- const productSwitcher = {
- label: 'Product Switcher'
- };
-
- const coPilotShell = (
-
- );
-
- test('create shellbar', () => {
- let component = renderer.create(simpleShellBar);
- let tree = component.toJSON();
- expect(tree).toMatchSnapshot();
-
- component = renderer.create(simpleShellBarWithClass);
- tree = component.toJSON();
- expect(tree).toMatchSnapshot();
- });
-
- describe('Prop spreading', () => {
- xtest('should allow props to be spread to the Shellbar component', () => {
- // TODO: placeholder for this test description once that functionality is built
-
- // NOTE: there are numerous other elements and components contained within Shellbar
- // so there should be tests added for each once the functionality is present.
-
- const element = mount(
);
-
- expect(
- element.getDOMNode().attributes['data-sample'].value
- ).toBe('Sample');
- });
+ const profile1 = {
+ initials: 'JS',
+ userName: 'John Snow',
+ colorAccent: 8
+ };
+
+ const profileMenu = [
+ {
+ name: 'Settings',
+ glyph: 'action-settings',
+ size: 's',
+ callback: () => alert('Settings selected!')
+ },
+ {
+ name: 'Sign Out',
+ glyph: 'log',
+ size: 's',
+ callback: () => alert('Sign Out selected!')
+ }
+ ];
+
+ const simpleShellBar = (
+
+ }
+ productTitle='Corporate Portal'
+ profile={profile1}
+ profileMenu={profileMenu} />
+ );
+
+ const simpleShellBarWithClass = (
+
+ }
+ productTitle='Corporate Portal'
+ profile={profile1}
+ profileMenu={profileMenu} />
+ );
+
+ const searchInput = {
+ label: 'Search',
+ placeholder: 'Enter a fruit',
+ onSearch: function(searchTerm) {
+ alert(`Search fired for ${searchTerm}`);
+ },
+ callback: () => alert('Search selected!')
+ };
+
+ const actions = [
+ {
+ glyph: 'settings',
+ label: 'Settings',
+ notificationCount: 5,
+ callback: () => alert('Settings selected!'),
+ menu: (
+
+ )
+ }
+ ];
+
+ const notifications = {
+ notificationCount: 2,
+ label: 'Notifications',
+ notificationsBody: (
+
+ ),
+ noNotificationsBody: (
+
+ ),
+ callback: () => alert('Notification selected!')
+ };
+
+ const profile = {
+ initials: 'JS',
+ userName: 'John Snow',
+ colorAccent: 8
+ };
+
+ const productMenu = [
+ { name: 'Application A', callback: () => alert('Application A selected!') },
+ { name: 'Application B', callback: () => alert('Application B selected!') },
+ { name: 'Application C', callback: () => alert('Application C selected!') },
+ { name: 'Application D', callback: () => alert('Application D selected!') }
+ ];
+
+ const productSwitcherList = [
+ {
+ title: 'Fiori Home',
+ glyph: 'home',
+ callback: () => alert('Fiori Home selected!')
+ },
+ {
+ title: 'S/4 HANA Cloud',
+ glyph: 'cloud',
+ callback: () => alert('S/4 HANA Cloud selected!')
+ }
+ ];
+
+ const productSwitcher = {
+ label: 'Product Switcher'
+ };
+
+ const coPilotShell = (
+
+ );
+
+ test('create shellbar', () => {
+ let component = renderer.create(simpleShellBar);
+ let tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+
+ component = renderer.create(simpleShellBarWithClass);
+ tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+
+ component = renderer.create(coPilotShell);
+ tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ });
+
+ describe('Prop spreading', () => {
+ xtest('should allow props to be spread to the Shellbar component', () => {
+ // TODO: placeholder for this test description once that functionality is built
+
+ // NOTE: there are numerous other elements and components contained within Shellbar
+ // so there should be tests added for each once the functionality is present.
+
+ const element = mount(
);
+
+ expect(element.getDOMNode().attributes['data-sample'].value).toBe(
+ 'Sample'
+ );
});
+ });
});
diff --git a/src/Shellbar/__snapshots__/Shellbar.test.js.snap b/src/Shellbar/__snapshots__/Shellbar.test.js.snap
index 791316fcd..82a36c2e3 100644
--- a/src/Shellbar/__snapshots__/Shellbar.test.js.snap
+++ b/src/Shellbar/__snapshots__/Shellbar.test.js.snap
@@ -211,3 +211,533 @@ exports[`
create shellbar 2`] = `