File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util
test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import java.util.Locale
18
18
*/
19
19
val AccountSummary .initials: String
20
20
get() {
21
- val names = this .name.orEmpty().split(" " )
21
+ val names = this .name.orEmpty().split(" " ).filter { it.isNotBlank() }
22
22
return if (names.size >= 2 ) {
23
23
names
24
24
.take(2 )
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ class AccountSummaryExtensionsTest {
12
12
13
13
@Suppress(" MaxLineLength" )
14
14
@Test
15
- fun `initials should return the starting letters of the first two words for a multi-word name` () {
15
+ fun `initials should return the starting letters of the first two words for a multi-word name and ignore any extra spaces ` () {
16
16
assertEquals(
17
17
" FS" ,
18
18
mockk<AccountSummary > {
19
- every { name } returns " First Second Third"
19
+ every { name } returns " First Second Third"
20
20
}
21
21
.initials,
22
22
)
You can’t perform that action at this time.
0 commit comments