diff --git a/packages/material-ui/src/useScrollTrigger/useScrollTrigger.test.js b/packages/material-ui/src/useScrollTrigger/useScrollTrigger.test.js index e9d5ec1081b09a..02237ce1780424 100644 --- a/packages/material-ui/src/useScrollTrigger/useScrollTrigger.test.js +++ b/packages/material-ui/src/useScrollTrigger/useScrollTrigger.test.js @@ -259,5 +259,16 @@ describe('useScrollTrigger', () => { assert.strictEqual(text(), test.result, `Index: ${index} ${JSON.stringify(test)}`); }); }); + + it('should correctly evaluate scroll events on page first load', () => { + [ + { offset: 101, result: 'true' }, + { offset: 100, result: 'false' }, + ].forEach((test, index) => { + window.pageYOffset = test.offset; + mount(); + assert.strictEqual(text(), test.result, `Index: ${index} ${JSON.stringify(test)}`); + }); + }); }); });