mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-12 01:13:30 -04:00
Update Android tests (#1013)
This commit is contained in:
committed by
Leendert de Borst
parent
cec6e7c303
commit
dfb8c86366
@@ -94,12 +94,17 @@ object CredentialMatcher {
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Domain key match against notes only (since name is already checked in step 3)
|
||||
// 4. Domain key match against service name, URL, and notes
|
||||
matches += credentials.filter { cred ->
|
||||
cred.notes?.lowercase()?.contains(domainKey) == true
|
||||
val nameMatches = cred.service.name?.trim()?.lowercase()?.contains(domainKey) == true
|
||||
val urlMatches = cred.service.url?.trim()?.lowercase()?.contains(domainKey) == true
|
||||
val notesMatches = cred.notes?.lowercase()?.contains(domainKey) == true
|
||||
|
||||
nameMatches || urlMatches || notesMatches
|
||||
}
|
||||
|
||||
return matches
|
||||
// Deduplicate matches based on credential ID to avoid duplicates from different matching strategies
|
||||
return matches.distinctBy { it.id }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,8 +58,9 @@ class AutofillTest {
|
||||
"www.coolblue.nl",
|
||||
)
|
||||
|
||||
assertEquals(1, matches.size)
|
||||
assertEquals(2, matches.size)
|
||||
assertEquals("Coolblue", matches[0].service.name)
|
||||
assertEquals("Coolblue App", matches[1].service.name)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user