Skip to content

Commit 504a06b

Browse files
committed
ran npm run prettier and this formatted tests/unit/DisplayNamesShouldParseHTMLTest.tsx
1 parent caf1fbb commit 504a06b

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

tests/unit/DisplayNamesShouldParseHTMLTest.tsx

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,28 @@ describe('DisplayNames - shouldParseHtml prop', () => {
4242
});
4343

4444
it('should NOT parse HTML by default (shouldParseHtml defaults to false)', () => {
45-
render(<DisplayNames fullTitle={testTitle} numberOfLines={1} tooltipEnabled={false} />);
45+
render(
46+
<DisplayNames
47+
fullTitle={testTitle}
48+
numberOfLines={1}
49+
tooltipEnabled={false}
50+
/>,
51+
);
4652

4753
// With shouldParseHtml = false (default), "< >" should be preserved
4854
expect(screen.getByText('< >')).toBeTruthy();
4955
});
5056

5157
it('should parse HTML when shouldParseHtml is explicitly set to true', () => {
5258
const htmlTitle = '<b>Bold Text</b>';
53-
render(<DisplayNames fullTitle={htmlTitle} numberOfLines={1} tooltipEnabled={false} shouldParseHtml />);
59+
render(
60+
<DisplayNames
61+
fullTitle={htmlTitle}
62+
numberOfLines={1}
63+
tooltipEnabled={false}
64+
shouldParseHtml
65+
/>,
66+
);
5467

5568
// With shouldParseHtml = true, HTML tags should be stripped
5669
expect(screen.getByText('Bold Text')).toBeTruthy();
@@ -59,21 +72,40 @@ describe('DisplayNames - shouldParseHtml prop', () => {
5972

6073
it('should preserve special characters when shouldParseHtml is false', () => {
6174
const specialCharsTitle = '< > & " \' test';
62-
render(<DisplayNames fullTitle={specialCharsTitle} numberOfLines={1} tooltipEnabled={false} />);
75+
render(
76+
<DisplayNames
77+
fullTitle={specialCharsTitle}
78+
numberOfLines={1}
79+
tooltipEnabled={false}
80+
/>,
81+
);
6382

6483
// Special characters should be preserved when not parsing HTML
6584
expect(screen.getByText(specialCharsTitle)).toBeTruthy();
6685
});
6786

6887
it('should show "hidden" when title is empty and HTML parsing is disabled', () => {
69-
render(<DisplayNames fullTitle="" numberOfLines={1} tooltipEnabled={false} />);
88+
render(
89+
<DisplayNames
90+
fullTitle=""
91+
numberOfLines={1}
92+
tooltipEnabled={false}
93+
/>,
94+
);
7095

7196
expect(screen.getByText('hidden')).toBeTruthy();
7297
});
7398

7499
it('should show "hidden" when title becomes empty after HTML parsing', () => {
75100
const onlyTagsTitle = '<div></div>';
76-
render(<DisplayNames fullTitle={onlyTagsTitle} numberOfLines={1} tooltipEnabled={false} shouldParseHtml />);
101+
render(
102+
<DisplayNames
103+
fullTitle={onlyTagsTitle}
104+
numberOfLines={1}
105+
tooltipEnabled={false}
106+
shouldParseHtml
107+
/>,
108+
);
77109

78110
// After parsing, only tags remain which get stripped to empty string
79111
expect(screen.getByText('hidden')).toBeTruthy();

0 commit comments

Comments
 (0)