import * as React from 'react'; import { render } from '@testing-library/react'; import { getPopupContainer } from '../get-popup-container'; import { CnPageScrollDomId } from '@/constant/page'; describe('getPopupContainer', () => { it('should return the provided popup container if it exists', () => { const popupContainer = document.createElement('div'); const result = getPopupContainer(popupContainer); expect(result).toBe(popupContainer); }); it('should return document.body if no popup container is provided', () => { const result = getPopupContainer()(); expect(result).toBe(document.body); }); it('should return the closest CnPageScrollDomSelector element if target is provided', () => { const { container } = render(