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

terra-abstract-modal

Package Overview
Dependencies
Maintainers
10
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-abstract-modal - npm Package Compare versions

Comparing version 3.32.0 to 3.33.0

5

CHANGELOG.md

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

## 3.33.0 - (April 6, 2021)
* Changed
* updated jest tests to not expect a mock to cross it blocks.
## 3.32.0 - (March 9, 2021)

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

8

package.json
{
"name": "terra-abstract-modal",
"main": "lib/AbstractModal.js",
"version": "3.32.0",
"version": "3.33.0",
"description": "The abstract modal is a structural component that provides the ability to display portal'd content in a layer above the app.",

@@ -36,3 +36,3 @@ "repository": {

"react-portal": "^4.1.2",
"terra-theme-context": "^1.5.0",
"terra-theme-context": "^1.6.0",
"terra-visually-hidden-text": "^2.0.0",

@@ -51,3 +51,3 @@ "wicg-inert": "^3.0.0"

"test": "npm run lint && npm run jest && npm run wdio",
"jest": "jest --config ../../jestconfig.js",
"jest": "jest --config ../../jest.config.js",
"wdio-default": "cd ../.. && npx wdio",

@@ -58,3 +58,3 @@ "wdio-lowlight": "cd ../.. && THEME=clinical-lowlight-theme npx wdio",

},
"gitHead": "119a489cfe421e59bfcdc6ebfcbd0c3ff9aae3c2"
"gitHead": "1fa6d8cf63b0e669846ff5bc3b085a95058c029e"
}

@@ -25,11 +25,7 @@ import { hideModalDomUpdates, showModalDomUpdates } from '../../src/inertHelpers';

describe('when inert has not been set on root', () => {
beforeAll(() => {
it('sets inert on root', () => {
showModalDomUpdates(mockModalElement, '#root');
});
it('sets inert on root', () => {
expect(mockSetAttribute).toHaveBeenNthCalledWith(1, 'inert', 'true');
});
it('sets modal-overlay count to 1', () => {
// sets modal-overlay count to 1', () => {
expect(mockSetAttribute).toHaveBeenNthCalledWith(2, 'data-abstract-modal-overlay-count', '1');

@@ -40,14 +36,9 @@ });

describe('when inert has already been set on root', () => {
beforeAll(() => {
jest.clearAllMocks();
it('does not resets inert on root', () => {
mockGetAttribute.mockReturnValue('1');
showModalDomUpdates(mockModalElement, '#root');
});
it('does not resets inert on root', () => {
expect(mockSetAttribute).not.toHaveBeenNthCalledWith(1, 'inert', 'true');
});
it('sets modal-overlay count to 1', () => {
// sets modal-overlay count to 1
expect(mockSetAttribute).toHaveBeenNthCalledWith(1, 'data-abstract-modal-overlay-count', '2');

@@ -103,11 +94,7 @@ });

describe('when inert has been set once on root', () => {
beforeAll(() => {
it('removes modal-overlay count', () => {
hideModalDomUpdates(mockModalTriggerElement, '#root');
});
it('removes modal-overlay count', () => {
expect(mockRemoveAttribute).toHaveBeenNthCalledWith(1, 'data-abstract-modal-overlay-count');
});
it('removes inert on root', () => {
// removes inert on root
expect(mockRemoveAttribute).toHaveBeenNthCalledWith(2, 'inert');

@@ -118,14 +105,9 @@ });

describe('when inert has been set multiple times on root', () => {
beforeAll(() => {
jest.clearAllMocks();
it('reduces the modal-overlay count to 1', () => {
mockGetAttribute.mockReturnValue('2');
hideModalDomUpdates(mockModalTriggerElement, '#root');
});
it('reduces the modal-overlay count to 1', () => {
expect(mockSetAttribute).toHaveBeenNthCalledWith(1, 'data-abstract-modal-overlay-count', '1');
});
it('does not remove inert on root', () => {
// does not remove inert on root
expect(mockRemoveAttribute).not.toHaveBeenNthCalledWith(1, 'inert');

@@ -132,0 +114,0 @@ });

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