This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed
test/components/views/right_panel Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,21 @@ describe("<DeviceItem />", () => {
488488 expect ( mockVerifyDevice ) . toHaveBeenCalledTimes ( 1 ) ;
489489 expect ( mockVerifyDevice ) . toHaveBeenCalledWith ( defaultUser , device ) ;
490490 } ) ;
491+
492+ it ( "with display name" , async ( ) => {
493+ const { container } = renderComponent ( ) ;
494+ await act ( flushPromises ) ;
495+
496+ expect ( container ) . toMatchSnapshot ( ) ;
497+ } ) ;
498+
499+ it ( "without display name" , async ( ) => {
500+ const device = { deviceId : "deviceId" } as Device ;
501+ const { container } = renderComponent ( { device, userId : defaultUserId } ) ;
502+ await act ( flushPromises ) ;
503+
504+ expect ( container ) . toMatchSnapshot ( ) ;
505+ } ) ;
491506} ) ;
492507
493508describe ( "<UserOptionsSection />" , ( ) => {
Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` <DeviceItem /> with display name 1` ] = `
4+ <div >
5+ <div
6+ class = " mx_AccessibleButton mx_UserInfo_device mx_UserInfo_device_unverified"
7+ role = " button"
8+ tabindex = " 0"
9+ title = " deviceId"
10+ >
11+ <div
12+ class = " mx_E2EIcon mx_E2EIcon_normal"
13+ />
14+ <div
15+ class = " mx_UserInfo_device_name"
16+ >
17+ deviceName
18+ </div >
19+ <div
20+ class = " mx_UserInfo_device_trusted"
21+ />
22+ </div >
23+ </div >
24+ ` ;
25+
26+ exports [` <DeviceItem /> without display name 1` ] = `
27+ <div >
28+ <div
29+ class = " mx_AccessibleButton mx_UserInfo_device mx_UserInfo_device_unverified"
30+ role = " button"
31+ tabindex = " 0"
32+ title = " deviceId"
33+ >
34+ <div
35+ class = " mx_E2EIcon mx_E2EIcon_normal"
36+ />
37+ <div
38+ class = " mx_UserInfo_device_name"
39+ >
40+ deviceId
41+ </div >
42+ <div
43+ class = " mx_UserInfo_device_trusted"
44+ />
45+ </div >
46+ </div >
47+ ` ;
You can’t perform that action at this time.
0 commit comments