Skip to content

Commit

Permalink
Fixed test build failures caused by ChromeHeadless height and a test …
Browse files Browse the repository at this point in the history
…dependent on window height (#10532)

* Fixed test due to chrome headless issue in size

* Fixed test due to chrome headless issue in size
  • Loading branch information
offtherailz authored Sep 5, 2024
1 parent 842b59b commit 5c52799
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe('withMediaVisibilityContainer HOC', () => {
ReactDOM.render(
<div
id="scroll-container"
style={{ width: 512, height: 512, overflow: 'scroll' }}>
<div style={{ height: 1024 }}></div>
style={{ width: 10, height: 10, overflow: 'scroll' }}>
<div style={{ height: 20 }}></div>
<TestComponentWithVisibility
lazy
debounceTime={DEBOUNCE_TIME} />
Expand All @@ -64,11 +64,12 @@ describe('withMediaVisibilityContainer HOC', () => {

it('scroll in view should render the actual component (lazy loading)', (done) => {
const DEBOUNCE_TIME = 1;
// note: this test fails if the window is too small in height
ReactDOM.render(
<div
id="scroll-container"
style={{ width: 512, height: 512, overflow: 'scroll' }}>
<div style={{ height: 1024 }}></div>
style={{ width: 10, height: 10, overflow: 'scroll' }}>
<div style={{ height: 20 }}></div>
<Media mediaViewer={withMediaVisibilityContainer(() => <div className="test-component"></div>)} debounceTime={DEBOUNCE_TIME}/>
</div>,
document.getElementById("container"));
Expand Down Expand Up @@ -101,8 +102,8 @@ describe('withMediaVisibilityContainer HOC', () => {
ReactDOM.render(
<div
id="scroll-container"
style={{ width: 512, height: 512, overflow: 'scroll' }}>
<div style={{ height: 1024 }}></div>
style={{ width: 10, height: 10, overflow: 'scroll' }}>
<div style={{ height: 20 }}></div>
<TestComponentWithVisibility
lazy
debounceTime={DEBOUNCE_TIME} />
Expand Down

0 comments on commit 5c52799

Please sign in to comment.