Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terra-alert

Package Overview
Dependencies
Maintainers
8
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-alert - npm Package Compare versions

Comparing version 4.88.0 to 4.89.0

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## 4.89.0 - (February 15, 2024)
* Changed
* Minor dependency version bump.
## 4.88.0 - (January 9, 2024)

@@ -7,0 +12,0 @@

4

lib/Alert.js

@@ -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-alert",
"version": "4.88.0",
"version": "4.89.0",
"description": "The Terra Alert component is a notification banner that can be rendered in your application when there is information that you want to bring to the user's attention. The Alert component supports a number of built-in notification types that render with pre-defined colors and icons that help the user understand the severity and meaning of the notification. A custom notification type is also supported that allows your application to customize an alert that may not fit into the pre-defined types.",

@@ -27,7 +27,7 @@ "author": "Cerner Corporation",

"prop-types": "^15.5.8",
"terra-button": "^3.73.0",
"terra-icon": "^3.59.0",
"terra-responsive-element": "^5.39.0",
"terra-button": "^3.74.0",
"terra-icon": "^3.60.0",
"terra-responsive-element": "^5.40.0",
"terra-theme-context": "^1.0.0",
"terra-visually-hidden-text": "^2.37.0",
"terra-visually-hidden-text": "^2.38.0",
"uuid": "3.4.0"

@@ -53,3 +53,3 @@ },

},
"gitHead": "11a2f3a121e9701433769d213d55bda871139935"
"gitHead": "31ec38baf909fed741b41a204f7fa28884ab327e"
}
import React from 'react';
/* eslint-disable-next-line import/no-extraneous-dependencies */
import { shallowWithIntl, mountWithIntl } from 'terra-enzyme-intl';
import IconAlert from 'terra-icon/lib/icon/IconAlert';

@@ -28,3 +26,3 @@ import IconDiamondSymbol from 'terra-icon/lib/icon/IconDiamondSymbol';

it('should render a default component', () => {
const wrapper = mountWithIntl(<Alert />);
const wrapper = enzymeIntl.mountWithIntl(<Alert />);

@@ -39,3 +37,3 @@ const alert = wrapper.find('Alert');

it('should render a default notification banner with default props', () => {
const wrapper = shallowWithIntl(<Alert />).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert />).dive();

@@ -55,3 +53,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an alert with provided role', () => {
const wrapper = shallowWithIntl(<Alert role="status" />).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert role="status" />).dive();

@@ -67,3 +65,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render disableAlertActionFocus when provided', () => {
const wrapper = mountWithIntl(<Alert disableAlertActionFocus />);
const wrapper = enzymeIntl.mountWithIntl(<Alert disableAlertActionFocus />);

@@ -76,3 +74,3 @@ const alert = wrapper.find('Alert');

it('should render an alert with provided title', () => {
const wrapper = shallowWithIntl(<Alert title="Custom Title" />).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert title="Custom Title" />).dive();
const alertTitle = wrapper.find('.title');

@@ -94,3 +92,3 @@

const mockOnDismiss = jest.fn();
const wrapper = shallowWithIntl(<Alert onDismiss={mockOnDismiss}>This is a test</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert onDismiss={mockOnDismiss}>This is a test</Alert>).dive();

@@ -110,3 +108,3 @@ const dismissButton = wrapper.find(Button);

it('should render an Alert component of type alert', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.ALERT}>This is a test</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.ALERT}>This is a test</Alert>).dive();

@@ -124,3 +122,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type error', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.ERROR}>This is an error.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.ERROR}>This is an error.</Alert>).dive();

@@ -138,3 +136,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type warning', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.WARNING}>This is an warning.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.WARNING}>This is an warning.</Alert>).dive();

@@ -152,3 +150,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type advisory', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.ADVISORY}>This is an advisory alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.ADVISORY}>This is an advisory alert.</Alert>).dive();

@@ -165,3 +163,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an unsatisfied Alert', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.UNSATISFIED}>This is an unsatisfied alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.UNSATISFIED}>This is an unsatisfied alert.</Alert>).dive();

@@ -179,3 +177,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an unverified Alert', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.UNVERIFIED}>This is an unverified alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.UNVERIFIED}>This is an unverified alert.</Alert>).dive();

@@ -193,3 +191,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type info', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.INFO}>This is an information alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.INFO}>This is an information alert.</Alert>).dive();

@@ -207,3 +205,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type success', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.SUCCESS}>This is a success alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.SUCCESS}>This is a success alert.</Alert>).dive();

@@ -221,3 +219,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type custom', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.CUSTOM} title="Help!" customIcon={<IconHelp />} customColorClass="terra-alert-custom-orange-color">This is a custom alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.CUSTOM} title="Help!" customIcon={<IconHelp />} customColorClass="terra-alert-custom-orange-color">This is a custom alert.</Alert>).dive();

@@ -235,3 +233,3 @@ const alertDiv = wrapper.find('div.alert-base');

it('should render an Alert component of type info with custom title and HTML content', () => {
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.INFO} title="Gettysburg Address"><span>Four score and seven years ago . . .</span></Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.INFO} title="Gettysburg Address"><span>Four score and seven years ago . . .</span></Alert>).dive();

@@ -257,3 +255,3 @@ const alertDiv = wrapper.find('div.alert-base');

const mockOnClick = jest.fn();
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.SUCCESS} action={<Button text="Action" variant={Button.Opts.Variants.EMPHASIS} onClick={mockOnClick} />}>This is a success alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.SUCCESS} action={<Button text="Action" variant={Button.Opts.Variants.EMPHASIS} onClick={mockOnClick} />}>This is a success alert.</Alert>).dive();

@@ -277,3 +275,3 @@ const alertDiv = wrapper.find('div.alert-base');

const mockOnDismiss = jest.fn();
const wrapper = shallowWithIntl(<Alert type={Alert.Opts.Types.CUSTOM} onDismiss={mockOnDismiss} title="Help!" customIcon={<IconHelp />} customColorClass="terra-alert-custom-orange-color" action={<Button text="Action" variant={Button.Opts.Variants.EMPHASIS} onClick={mockOnClick} />}>This is a custom alert.</Alert>).dive();
const wrapper = enzymeIntl.shallowWithIntl(<Alert type={Alert.Opts.Types.CUSTOM} onDismiss={mockOnDismiss} title="Help!" customIcon={<IconHelp />} customColorClass="terra-alert-custom-orange-color" action={<Button text="Action" variant={Button.Opts.Variants.EMPHASIS} onClick={mockOnClick} />}>This is a custom alert.</Alert>).dive();

@@ -304,3 +302,3 @@ const alertDiv = wrapper.find('div.alert-base');

beforeEach(() => {
wrapper = shallowWithIntl(
wrapper = enzymeIntl.shallowWithIntl(
<Alert

@@ -333,3 +331,3 @@ type={Alert.Opts.Types.CUSTOM}

beforeEach(() => {
wrapper = shallowWithIntl(
wrapper = enzymeIntl.shallowWithIntl(
<Alert

@@ -370,3 +368,3 @@ type={Alert.Opts.Types.CUSTOM}

beforeEach(() => {
wrapper = shallowWithIntl(
wrapper = enzymeIntl.shallowWithIntl(
<Alert

@@ -405,3 +403,3 @@ type={Alert.Opts.Types.SUCCESS}

beforeEach(() => {
wrapper = shallowWithIntl(
wrapper = enzymeIntl.shallowWithIntl(
<Alert

@@ -441,3 +439,3 @@ type={Alert.Opts.Types.SUCCESS}

beforeEach(() => {
wrapper = shallowWithIntl(
wrapper = enzymeIntl.shallowWithIntl(
<Alert

@@ -487,5 +485,5 @@ type={Alert.Opts.Types.SUCCESS}

const wrapper = shallowWithIntl(<Alert type="success" />);
const wrapper = enzymeIntl.shallowWithIntl(<Alert type="success" />);
const headerContainer = wrapper.dive().dive();
expect(headerContainer).toMatchSnapshot();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc