bpk-animate-height
Advanced tools
Comparing version 4.1.9 to 4.1.10
{ | ||
"name": "bpk-animate-height", | ||
"version": "4.1.9", | ||
"version": "4.1.10", | ||
"description": "Animate height using CSS transitions.", | ||
@@ -15,3 +15,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "c4fd56a7be2e7e027844bc2fda2be44c3b64b315", | ||
"gitHead": "fad90303a5cb542fc3f7c28758200d928342aa10", | ||
"dependencies": { | ||
@@ -25,4 +25,4 @@ "prop-types": "^15.7.2" | ||
"@skyscanner/bpk-foundations-web": "^8.0.0", | ||
"bpk-component-button": "^6.2.4" | ||
"bpk-component-button": "^6.2.5" | ||
} | ||
} |
@@ -20,4 +20,4 @@ /* | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import { render } from '@testing-library/react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom'; | ||
import { spacingSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6'; | ||
@@ -46,15 +46,17 @@ | ||
it('should set "display: none;" on contentElement if height is 0', () => { | ||
const tree = mount( | ||
it('content element should not be visible if height is 0', () => { | ||
const { rerender } = render( | ||
<AnimateHeight duration={0} height={0}> | ||
Content. | ||
</AnimateHeight>, | ||
{ lifecycleExperimental: true }, // See https://github.com/airbnb/enzyme/pull/318 | ||
); | ||
expect(tree.instance().contentElement.style.display).toEqual('none'); | ||
expect(screen.getByText('Content.')).not.toBeVisible(); | ||
tree.setProps({ height: spacingSm }).update(); | ||
expect(tree.instance().contentElement.style.display).toEqual(''); | ||
rerender( | ||
<AnimateHeight duration={0} height={spacingSm}> | ||
Content. | ||
</AnimateHeight>, | ||
); | ||
expect(screen.getByText('Content.')).toBeVisible(); | ||
}); | ||
@@ -61,0 +63,0 @@ |
270
23719