terra-list
Advanced tools
Comparing version 4.69.0 to 4.70.0
@@ -5,2 +5,7 @@ # Changelog | ||
## 4.70.0 - (February 15, 2024) | ||
* Updated | ||
* Added check for the position loss issue while dragging list item for `terra-list` inside `terra-slide-panel`. | ||
## 4.69.0 - (January 9, 2024) | ||
@@ -7,0 +12,0 @@ |
@@ -25,4 +25,4 @@ "use strict"; | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
@@ -297,3 +297,5 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
if (styleProperties && snapshot && snapshot.isDragging) { | ||
styleProperties.zIndex = zIndex; | ||
if (styleProperties.zIndex && styleProperties.zIndex !== zIndex) { | ||
styleProperties.zIndex = zIndex; | ||
} | ||
} | ||
@@ -314,3 +316,3 @@ return styleProperties; | ||
return _react.default.Children.map(object, function (listitem) { | ||
return /*#__PURE__*/_react.default.isValidElement(listitem) ? /*#__PURE__*/_react.default.cloneElement(listitem, { | ||
return ( /*#__PURE__*/_react.default.isValidElement(listitem)) ? /*#__PURE__*/_react.default.cloneElement(listitem, { | ||
isTabFocusDisabled: isTabFocusDisabled | ||
@@ -317,0 +319,0 @@ }) : null; |
@@ -26,4 +26,4 @@ "use strict"; | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
@@ -30,0 +30,0 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
@@ -26,4 +26,4 @@ "use strict"; | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
@@ -30,0 +30,0 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } |
{ | ||
"name": "terra-list", | ||
"version": "4.69.0", | ||
"version": "4.70.0", | ||
"description": "The Terra List is a structural component to arrange content within list/listitems.", | ||
@@ -25,3 +25,3 @@ "author": "Cerner Corporation", | ||
"dependencies": { | ||
"@cerner/terra-docs": "^1.10.0", | ||
"@cerner/terra-docs": "^1.11.0", | ||
"classnames": "^2.2.5", | ||
@@ -31,6 +31,6 @@ "keycode-js": "^3.1.0", | ||
"react-beautiful-dnd": "^13.1.1", | ||
"terra-icon": "^3.59.0", | ||
"terra-icon": "^3.60.0", | ||
"terra-mixins": "^1.41.0", | ||
"terra-theme-context": "^1.0.0", | ||
"terra-visually-hidden-text": "^2.37.0" | ||
"terra-visually-hidden-text": "^2.38.0" | ||
}, | ||
@@ -55,3 +55,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "11a2f3a121e9701433769d213d55bda871139935" | ||
"gitHead": "31ec38baf909fed741b41a204f7fa28884ab327e" | ||
} |
@@ -265,3 +265,5 @@ import React, { | ||
if (styleProperties && snapshot && snapshot.isDragging) { | ||
styleProperties.zIndex = zIndex; | ||
if (styleProperties.zIndex && styleProperties.zIndex !== zIndex) { | ||
styleProperties.zIndex = zIndex; | ||
} | ||
} | ||
@@ -268,0 +270,0 @@ return styleProperties; |
import React from 'react'; | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl'; | ||
import List, { Item, Section, Subsection } from '../../src/index'; | ||
@@ -14,3 +12,3 @@ | ||
const items = [item1, item2]; | ||
const component = mountWithIntl(<List isDraggable>{items}</List>); | ||
const component = enzymeIntl.mountWithIntl(<List isDraggable>{items}</List>); | ||
const list = component.find('Droppable'); | ||
@@ -25,3 +23,3 @@ expect(list.prop('droppableId')).toEqual('ListItem'); | ||
const items = [item1, item2]; | ||
const component = mountWithIntl(<Section title="test" isDraggable>{items}</Section>); | ||
const component = enzymeIntl.mountWithIntl(<Section title="test" isDraggable>{items}</Section>); | ||
const section = component.find('Droppable'); | ||
@@ -39,3 +37,3 @@ expect(section.prop('droppableId')).toEqual('listSection'); | ||
const items = [item1, item2, item3]; | ||
const component = mountWithIntl(<Subsection title="subsection" isDraggable>{items}</Subsection>); | ||
const component = enzymeIntl.mountWithIntl(<Subsection title="subsection" isDraggable>{items}</Subsection>); | ||
const subSection = component.find('Droppable'); | ||
@@ -51,3 +49,3 @@ expect(subSection.prop('droppableId')).toEqual('listSubSection'); | ||
const items = [item1, item2, item3]; | ||
const shallowComponent = shallowWithIntl(<List>{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List>{items}</List>).dive(); | ||
const list = shallowComponent.find('ul'); | ||
@@ -54,0 +52,0 @@ expect(list.length).toBe(1); |
import React from 'react'; | ||
import ThemeContextProvider from 'terra-theme-context/lib/ThemeContextProvider'; | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl'; | ||
import List, { Item, Section } from '../../src/index'; | ||
@@ -15,3 +13,3 @@ | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<List>{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List>{items}</List>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -21,3 +19,3 @@ }); | ||
it('should render with no items', () => { | ||
const shallowComponent = shallowWithIntl(<List />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -33,3 +31,3 @@ }); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<List dividerStyle="standard">{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List dividerStyle="standard">{items}</List>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -45,3 +43,3 @@ }); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<List dividerStyle="bottom-only">{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List dividerStyle="bottom-only">{items}</List>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -57,3 +55,3 @@ }); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<List paddingStyle="standard">{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List paddingStyle="standard">{items}</List>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -69,3 +67,3 @@ }); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<List paddingStyle="compact">{items}</List>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<List paddingStyle="compact">{items}</List>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -81,3 +79,3 @@ }); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<div> | ||
@@ -98,3 +96,3 @@ <p id="list-help"> Navigate this list using the arrow keys. </p> | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<List ariaDescription="Navigate this list using the arrow keys.">{items}</List>, | ||
@@ -111,3 +109,3 @@ ).dive(); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<div> | ||
@@ -128,3 +126,3 @@ <p id="list-details"> Here is some more information about this list. </p> | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<div> | ||
@@ -145,3 +143,3 @@ <p id="list-help"> Navigate this list using the arrow keys. </p> | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<List ariaDescription="Navigate this list using the arrow keys.">{items}</List>, | ||
@@ -159,3 +157,3 @@ ).dive(); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<div> | ||
@@ -176,3 +174,3 @@ <p id="list-details"> Here is some more information about this list. </p> | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<List ariaSelectionStyle="single-select">{items}</List>, | ||
@@ -190,3 +188,3 @@ ).dive(); | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<List ariaSelectionStyle="multi-select">{items}</List>, | ||
@@ -198,3 +196,3 @@ ).dive(); | ||
it('should render with null sections', () => { | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<List dividerStyle="standard" role="listbox"> | ||
@@ -214,3 +212,3 @@ <Section title="section 1" isCollapsed /> | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mountWithIntl( | ||
const wrapper = enzymeIntl.mountWithIntl( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -217,0 +215,0 @@ <List /> |
import React from 'react'; | ||
import ThemeContextProvider from 'terra-theme-context/lib/ThemeContextProvider'; | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl'; | ||
import ListItem from '../../src/ListItem'; | ||
@@ -9,3 +7,3 @@ | ||
it('should render with className', () => { | ||
const shallowComponent = shallowWithIntl(<ListItem className="textClass" />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<ListItem className="textClass" />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -15,3 +13,3 @@ }); | ||
it('should render with content', () => { | ||
const shallowComponent = shallowWithIntl(<ListItem><p>text</p></ListItem>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<ListItem><p>text</p></ListItem>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -21,3 +19,3 @@ }); | ||
it('should render with selected', () => { | ||
const shallowComponent = shallowWithIntl(<ListItem isSelectable isSelected />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<ListItem isSelectable isSelected />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -27,3 +25,3 @@ }); | ||
it('should render with isSelectable', () => { | ||
const shallowComponent = shallowWithIntl(<ListItem isSelectable />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<ListItem isSelectable />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -33,3 +31,3 @@ }); | ||
it('should render with hasChevron', () => { | ||
const shallowComponent = shallowWithIntl(<ListItem hasChevron />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<ListItem hasChevron />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -41,3 +39,3 @@ }); | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<ListItem title="test" isSelectable onSelect={mockCallBack} refCallback={jest.fn()} />, | ||
@@ -55,3 +53,3 @@ ).dive(); | ||
const shallowComponent = shallowWithIntl( | ||
const shallowComponent = enzymeIntl.shallowWithIntl( | ||
<ListItem title="test" isSelectable isTabFocusDisabled onSelect={mockCallBack} refCallback={jest.fn()} />, | ||
@@ -65,3 +63,3 @@ ).dive(); | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mountWithIntl( | ||
const wrapper = enzymeIntl.mountWithIntl( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -68,0 +66,0 @@ <ListItem /> |
import React from 'react'; | ||
import ThemeContextProvider from 'terra-theme-context/lib/ThemeContextProvider'; | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl'; | ||
@@ -17,3 +15,3 @@ import { Item, Section } from '../../src/index'; | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<Section title="test">{items}</Section>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test">{items}</Section>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -23,3 +21,3 @@ }); | ||
it('should render with no items', () => { | ||
const shallowComponent = shallowWithIntl(<Section title="test" />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test" />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -29,3 +27,3 @@ }); | ||
it('should render with level', () => { | ||
const shallowComponent = shallowWithIntl(<Section title="test" level={3} />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test" level={3} />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -35,3 +33,3 @@ }); | ||
it('should render with isCollapsed', () => { | ||
const shallowComponent = shallowWithIntl(<Section title="test" isCollapsed />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test" isCollapsed />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -41,3 +39,3 @@ }); | ||
it('should render with isCollapsible', () => { | ||
const shallowComponent = shallowWithIntl(<Section title="test" isCollapsible />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test" isCollapsible />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -47,3 +45,3 @@ }); | ||
it('should render with callback functions', () => { | ||
const shallowComponent = shallowWithIntl(<Section title="test" refCallback={jest.fn()} onSelect={jest.fn()} />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Section title="test" refCallback={jest.fn()} onSelect={jest.fn()} />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -53,3 +51,3 @@ }); | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mountWithIntl( | ||
const wrapper = enzymeIntl.mountWithIntl( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -56,0 +54,0 @@ <ListSection title="test" /> |
@@ -8,3 +8,3 @@ import React from 'react'; | ||
it('should render default', () => { | ||
const shallowComponent = shallow(<ListSectionHeader title="test" />); | ||
const shallowComponent = enzyme.shallow(<ListSectionHeader title="test" />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -14,3 +14,3 @@ }); | ||
it('should render with level', () => { | ||
const shallowComponent = shallow(<ListSectionHeader title="test" level={3} />); | ||
const shallowComponent = enzyme.shallow(<ListSectionHeader title="test" level={3} />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -20,3 +20,3 @@ }); | ||
it('should render with isCollapsed', () => { | ||
const shallowComponent = shallow(<ListSectionHeader title="test" isCollapsed />); | ||
const shallowComponent = enzyme.shallow(<ListSectionHeader title="test" isCollapsed />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -26,3 +26,3 @@ }); | ||
it('should render with isCollapsible', () => { | ||
const shallowComponent = shallow(<ListSectionHeader title="test" isCollapsible />); | ||
const shallowComponent = enzyme.shallow(<ListSectionHeader title="test" isCollapsible />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -34,3 +34,3 @@ }); | ||
const shallowComponent = shallow( | ||
const shallowComponent = enzyme.shallow( | ||
<ListSectionHeader title="test" level={1} isCollapsible onSelect={mockCallBack} refCallback={jest.fn()} />, | ||
@@ -46,3 +46,3 @@ ); | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mount( | ||
const wrapper = enzyme.mount( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -49,0 +49,0 @@ <ListSectionHeader title="test" /> |
import React from 'react'; | ||
import ThemeContextProvider from 'terra-theme-context/lib/ThemeContextProvider'; | ||
/* eslint-disable-next-line import/no-extraneous-dependencies */ | ||
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl'; | ||
@@ -16,3 +14,3 @@ import { Item, Subsection } from '../../src/index'; | ||
const items = [item1, item2, item3, item4, item5]; | ||
const shallowComponent = shallowWithIntl(<Subsection title="test">{items}</Subsection>).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test">{items}</Subsection>).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -22,3 +20,3 @@ }); | ||
it('should render with no items', () => { | ||
const shallowComponent = shallowWithIntl(<Subsection title="test" />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test" />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -28,3 +26,3 @@ }); | ||
it('should render with level', () => { | ||
const shallowComponent = shallowWithIntl(<Subsection title="test" level={3} />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test" level={3} />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -34,3 +32,3 @@ }); | ||
it('should render with isCollapsed', () => { | ||
const shallowComponent = shallowWithIntl(<Subsection title="test" isCollapsed />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test" isCollapsed />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -40,3 +38,3 @@ }); | ||
it('should render with isCollapsible', () => { | ||
const shallowComponent = shallowWithIntl(<Subsection title="test" isCollapsible />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test" isCollapsible />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -46,3 +44,3 @@ }); | ||
it('should render with callback functions', () => { | ||
const shallowComponent = shallowWithIntl(<Subsection title="test" refCallback={jest.fn()} onSelect={jest.fn()} />).dive(); | ||
const shallowComponent = enzymeIntl.shallowWithIntl(<Subsection title="test" refCallback={jest.fn()} onSelect={jest.fn()} />).dive(); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -52,3 +50,3 @@ }); | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mountWithIntl( | ||
const wrapper = enzymeIntl.mountWithIntl( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -55,0 +53,0 @@ <Subsection title="test" /> |
@@ -8,3 +8,3 @@ import React from 'react'; | ||
it('should render default', () => { | ||
const shallowComponent = shallow(<ListSubsectionHeader title="test" />); | ||
const shallowComponent = enzyme.shallow(<ListSubsectionHeader title="test" />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -14,3 +14,3 @@ }); | ||
it('should render with level', () => { | ||
const shallowComponent = shallow(<ListSubsectionHeader title="test" level={3} />); | ||
const shallowComponent = enzyme.shallow(<ListSubsectionHeader title="test" level={3} />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -20,3 +20,3 @@ }); | ||
it('should render with isCollapsed', () => { | ||
const shallowComponent = shallow(<ListSubsectionHeader title="test" isCollapsed />); | ||
const shallowComponent = enzyme.shallow(<ListSubsectionHeader title="test" isCollapsed />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -26,3 +26,3 @@ }); | ||
it('should render with isCollapsible', () => { | ||
const shallowComponent = shallow(<ListSubsectionHeader title="test" isCollapsible />); | ||
const shallowComponent = enzyme.shallow(<ListSubsectionHeader title="test" isCollapsible />); | ||
expect(shallowComponent).toMatchSnapshot(); | ||
@@ -34,3 +34,3 @@ }); | ||
const shallowComponent = shallow( | ||
const shallowComponent = enzyme.shallow( | ||
<ListSubsectionHeader title="test" isCollapsible onSelect={mockCallBack} refCallback={jest.fn()} />, | ||
@@ -46,3 +46,3 @@ ); | ||
it('correctly applies the theme context className', () => { | ||
const wrapper = mount( | ||
const wrapper = enzyme.mount( | ||
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}> | ||
@@ -49,0 +49,0 @@ <ListSubsectionHeader title="test" /> |
228005
3483
Updated@cerner/terra-docs@^1.11.0
Updatedterra-icon@^3.60.0