/** @jest-environment jsdom */ import { render, screen } from '@testing-library/react' import { WorkReviewAnnotationMarker } from '@/components/work-review/WorkReviewAnnotationMarker' const longComment = '这画太中古了,细节也过多,抢主体了,需要换成偏现代的画并减少背景元素' describe('WorkReviewAnnotationMarker', () => { test.each([ ['point', {}], ['rectangle', { x2: 0.7, y2: 0.6, shape: 'rectangle' as const }], ])('wraps the complete %s annotation comment instead of truncating it', (_shape, geometry) => { render( , ) const visibleComment = screen.getByText(longComment) expect(visibleComment).toHaveClass( 'whitespace-normal', 'break-words', 'max-w-[min(10rem,calc(100vw-3rem))]', 'sm:max-w-[min(14rem,calc(100vw-3rem))]', '[overflow-wrap:anywhere]', ) expect(visibleComment).not.toHaveClass('truncate') }) })