Skip to content

Commit c6ec1f7

Browse files
committed
Update ObjectPage.cy.tsx
1 parent 95ca2e7 commit c6ec1f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/main/src/components/ObjectPage/ObjectPage.cy.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import TitleLevel from '@ui5/webcomponents/dist/types/TitleLevel.js';
77
import ValueState from '@ui5/webcomponents-base/dist/types/ValueState.js';
88
import IllustrationMessageType from '@ui5/webcomponents-fiori/dist/types/IllustrationMessageType.js';
99
import type { CSSProperties } from 'react';
10-
import { useEffect, useLayoutEffect, useReducer, useRef, useState } from 'react';
10+
import { useEffect, useLayoutEffect, useReducer, useRef, useState, version as reactVersion } from 'react';
1111
import type { ObjectPagePropTypes } from '../..';
1212
import {
1313
CheckBox,
@@ -1852,7 +1852,13 @@ describe('ObjectPage', () => {
18521852
cy.findByText('Employee Details').parent().should('have.css', 'position', 'sticky');
18531853

18541854
cy.mount(
1855-
<ObjectPage titleArea={DPTitle} headerArea={DPContent} style={{ height: '1000px' }} data-testid="op">
1855+
<ObjectPage
1856+
titleArea={DPTitle}
1857+
headerArea={DPContent}
1858+
// scrollBehavior "auto" prevents flaky behavior when test is run with React18
1859+
style={{ height: '1000px', scrollBehavior: reactVersion.startsWith('18') ? 'auto' : 'smooth' }}
1860+
data-testid="op"
1861+
>
18561862
{OPContent}
18571863
{OPContentWithCustomHeaderSections}
18581864
</ObjectPage>,

0 commit comments

Comments
 (0)