Skip to content

Commit d818614

Browse files
committed
test: adjust UserItem.test.js
1 parent 165f4be commit d818614

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

src/components/TextAreaComposer/__tests__/UserItem.test.js

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,15 @@ afterEach(cleanup);
1313
describe('UserItem', () => {
1414
it('should render component with default props', () => {
1515
const { container } = render(<UserItem entity={{}} />);
16-
expect(container).toMatchInlineSnapshot(`
17-
<div>
18-
<div
19-
class="str-chat__user-item"
20-
>
21-
<div
22-
class="str-chat__avatar str-chat__message-sender-avatar str-chat__avatar--autocomplete-item str-chat__avatar--no-letters"
23-
data-testid="avatar"
24-
role="button"
25-
>
26-
<svg
27-
class="str-chat__icon str-chat__icon--user"
28-
fill="none"
29-
height="16"
30-
viewBox="0 0 16 16"
31-
width="16"
32-
xmlns="http://www.w3.org/2000/svg"
33-
>
34-
<path
35-
d="M8 2C9.1 2 10 2.9 10 4C10 5.1 9.1 6 8 6C6.9 6 6 5.1 6 4C6 2.9 6.9 2 8 2ZM8 12C10.7 12 13.8 13.29 14 14H2C2.23 13.28 5.31 12 8 12ZM8 0C5.79 0 4 1.79 4 4C4 6.21 5.79 8 8 8C10.21 8 12 6.21 12 4C12 1.79 10.21 0 8 0ZM8 10C5.33 10 0 11.34 0 14V16H16V14C16 11.34 10.67 10 8 10Z"
36-
fill="currentColor"
37-
/>
38-
</svg>
39-
</div>
40-
<span
41-
class="str-chat__user-item--name"
42-
data-testid="user-item-name"
43-
/>
44-
<div
45-
class="str-chat__user-item-at"
46-
>
47-
@
48-
</div>
49-
</div>
50-
</div>
51-
`);
16+
expect(container).toBeEmptyDOMElement();
5217
});
5318

5419
it('should render username if provided', async () => {
5520
const { container, getByText } = render(
5621
<UserItem
5722
entity={{
58-
itemNameParts: { match: 'g', parts: ['Frits Sissin', 'g'] },
5923
name: 'Frits Sissing',
24+
tokenizedDisplayName: { parts: ['Frits Sissin', 'g'], token: 'g' },
6025
}}
6126
/>,
6227
);
@@ -72,8 +37,8 @@ describe('UserItem', () => {
7237
entity={{
7338
id: '123',
7439
image: 'frits.jpg',
75-
itemNameParts: { match: 'f', parts: ['F', 'rits Sissing'] },
7640
name: 'Frits Sissing',
41+
tokenizedDisplayName: { parts: ['F', 'rits Sissing'], token: 'f' },
7742
}}
7843
/>,
7944
);

0 commit comments

Comments
 (0)