File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,31 @@ it('should show a follow contributor button for a single contributor when render
31
31
displayName = "Jon Doe"
32
32
/> ,
33
33
) ;
34
- expect ( getByText ( 'Follow Jon Doe' ) ) . toBeInTheDocument ( ) ;
34
+ expect ( getByText ( 'Follow Jon Doe in My Guardian ' ) ) . toBeInTheDocument ( ) ;
35
35
} ) ;
36
36
37
- it ( 'should show a follow contributor button for a single contributor when rendering for apps' , async ( ) => {
37
+ it ( 'should not include the in My Guardian when the display name is longer than 21 characters in the follow action' , ( ) => {
38
+ const { getByText } = render (
39
+ < FollowTagButton
40
+ isFollowing = { false }
41
+ onClickHandler = { ( ) => undefined }
42
+ displayName = "abcdefghijklmnopqrstuv"
43
+ /> ,
44
+ ) ;
45
+ expect ( getByText ( 'Follow abcdefghijklmnopqrstuv' ) ) . toBeInTheDocument ( ) ;
46
+ } ) ;
47
+
48
+ it ( 'should not include the in My Guardian when the display name is longer than 21 characters in the following action' , async ( ) => {
38
49
const { getByText } = render (
39
50
< FollowTagButton
40
51
onClickHandler = { ( ) => undefined }
41
52
isFollowing = { true }
42
- displayName = "Jon Doe "
53
+ displayName = "abcdefghijklmnopqrstuv "
43
54
/> ,
44
55
) ;
45
56
await waitFor ( ( ) =>
46
- expect ( getByText ( 'Following Jon Doe' ) ) . toBeInTheDocument ( ) ,
57
+ expect (
58
+ getByText ( 'Following abcdefghijklmnopqrstuv' ) ,
59
+ ) . toBeInTheDocument ( ) ,
47
60
) ;
48
61
} ) ;
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ const tagTextSpan = ({
79
79
displayName ?: string ;
80
80
} ) => (
81
81
< span >
82
- { isFollowing ? 'Following' : 'Follow' } { displayName }
82
+ { isFollowing ? 'Following' : 'Follow' } { displayName } { ' ' }
83
+ { displayName && displayName . length < 21 ? 'in My Guardian' : '' }
83
84
</ span >
84
85
) ;
85
86
You can’t perform that action at this time.
0 commit comments