@hashicorp/react-accordion
Advanced tools
Comparing version 0.0.1-react-v2.1 to 0.0.1-react-v2.2
{ | ||
"name": "@hashicorp/react-accordion", | ||
"version": "0.0.1-react-v2.1", | ||
"version": "0.0.1-react-v2.2", | ||
"description": "A block that displays a set of title + content items, with content collapsed by default, but expandable to view. Also includes an optional heading for the block.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -57,35 +57,2 @@ import React from 'react' | ||
}) | ||
/* | ||
@TODO test below relies on CSS to test visibility | ||
jest-transform-css seems to only support PostCSS with CSS modules | ||
Temporarily deferring these types of tests until we decide to either: | ||
1. Adopt CSS modules | ||
2. Find a way to expose transpiled CSS to Jest's DOM without CSS modules | ||
*/ | ||
/* | ||
it('should toggle content visibility when the title is clicked', () => { | ||
const { container, getByText } = render( | ||
<AccordionItems {...defaultProps} /> | ||
) | ||
// Re-render seems to be required to get styles to register correctly, not sure why | ||
render(<AccordionItems {...defaultProps} />, { | ||
container, | ||
getByText | ||
}) | ||
const headingElem = getByText(defaultProps.items[0].heading) | ||
const contentElem = getByText(defaultProps.items[0].content) | ||
expect(headingElem).toBeVisible() | ||
expect(contentElem).not.toBeVisible() | ||
fireEvent.click(headingElem) | ||
expect(contentElem).toBeVisible() | ||
fireEvent.click(headingElem) | ||
// Re-render seems to be required to get styles to register correctly, not sure why | ||
render(<AccordionItems {...defaultProps} />, { | ||
container, | ||
getByText | ||
}) | ||
expect(contentElem).not.toBeVisible() | ||
}) | ||
*/ | ||
}) |
@@ -32,35 +32,2 @@ import React from 'react' | ||
}) | ||
/* | ||
@TODO tests below relies on CSS to test visibility | ||
jest-transform-css seems to only support PostCSS with CSS modules | ||
Temporarily deferring these types of tests until we decide to either: | ||
1. Adopt CSS modules | ||
2. Find a way to expose transpiled CSS to Jest's DOM without CSS modules | ||
*/ | ||
/* | ||
it('should have visible content when expanded', () => { | ||
const someText = 'This is some test text for this test' | ||
const { getByText } = render( | ||
<Collapsible isCollapsed={false}>{someText}</Collapsible> | ||
) | ||
const contentElem = getByText(someText) | ||
expect(contentElem).toBeVisible() | ||
}) | ||
it('should not have visible content when collapsed', () => { | ||
const someText = 'This is some test text for this test' | ||
const { container, getByText } = render( | ||
<Collapsible isCollapsed={true}>{someText}</Collapsible> | ||
) | ||
// Re-render seems to be required to get styles to register correctly. | ||
// I'm not sure why. | ||
render(<Collapsible isCollapsed={true}>{someText}</Collapsible>, { | ||
container, | ||
getByText | ||
}) | ||
const contentElem = getByText(someText) | ||
expect(contentElem).not.toBeVisible() | ||
}) | ||
*/ | ||
}) |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
39261
22
610
1