diff --git a/packages/sqle/src/components/RuleDetail/__snapshots__/index.test.tsx.snap b/packages/sqle/src/components/RuleDetail/__snapshots__/index.test.tsx.snap
index 7f7c38775..5da09b15a 100644
--- a/packages/sqle/src/components/RuleDetail/__snapshots__/index.test.tsx.snap
+++ b/packages/sqle/src/components/RuleDetail/__snapshots__/index.test.tsx.snap
@@ -249,7 +249,7 @@ exports[`sqle/components/RuleDetail click return button 1`] = `
{
- let headerHeight = pageHeaderHeight;
- // #if [demo || ce]
- headerHeight += 184;
- // #else
- headerHeight += 128;
- // #endif
- return headerHeight;
-};
-
const RuleList: React.FC
= ({
rules = [],
pageHeaderHeight,
@@ -270,10 +258,16 @@ const RuleList: React.FC = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [rules]);
+ const pageRemainingHeight = useMemo(() => {
+ // #if [demo || ce]
+ return pageHeaderHeight + 184;
+ // #endif
+ }, [pageHeaderHeight]);
+
return (
<>
{
await act(async () => jest.advanceTimersByTime(3000));
expect(baseElement).toMatchSnapshot();
});
-
- it('page remaining height should increase 184', () => {
- expect(pageRemainingHeight(100)).toBe(284);
- });
});
diff --git a/packages/sqle/src/components/RuleList/test/RuleList.test.tsx b/packages/sqle/src/components/RuleList/test/RuleList.test.tsx
index c1558b272..09c8beffb 100644
--- a/packages/sqle/src/components/RuleList/test/RuleList.test.tsx
+++ b/packages/sqle/src/components/RuleList/test/RuleList.test.tsx
@@ -1,4 +1,4 @@
-import RuleList, { pageRemainingHeight } from '../RuleList';
+import RuleList from '../RuleList';
import { act, cleanup, fireEvent, screen } from '@testing-library/react';
import { renderWithTheme } from '../../../testUtils/customRender';
import { getBySelector } from '@actiontech/shared/lib/testUtil/customQuery';
@@ -182,8 +182,4 @@ describe('sqle/components/RuleList', () => {
await act(async () => jest.advanceTimersByTime(300));
expect(baseElement).toMatchSnapshot();
});
-
- it('page remaining height should increase 128', () => {
- expect(pageRemainingHeight(100)).toBe(228);
- });
});
diff --git a/packages/sqle/src/components/RuleList/test/__snapshots__/RuleList.test.tsx.snap b/packages/sqle/src/components/RuleList/test/__snapshots__/RuleList.test.tsx.snap
index c4647ba65..47c6e1069 100644
--- a/packages/sqle/src/components/RuleList/test/__snapshots__/RuleList.test.tsx.snap
+++ b/packages/sqle/src/components/RuleList/test/__snapshots__/RuleList.test.tsx.snap
@@ -4,7 +4,7 @@ exports[`sqle/components/RuleList scroll infinite list 1`] = `