feat(GODT-3121): refactored retrieval kb article index lookup.

This commit is contained in:
Xavier Michelon
2023-12-07 08:10:46 +01:00
parent b93c10ad47
commit 83935f3a03
3 changed files with 42 additions and 14 deletions

View File

@ -52,6 +52,18 @@ func Test_GetSuggestions(t *testing.T) {
require.Empty(t, suggestions)
}
func Test_GetArticleIndex(t *testing.T) {
index1, err := GetArticleIndex("https://proton.me/support/bridge-for-linux")
require.NoError(t, err)
index2, err := GetArticleIndex("HTTPS://PROTON.ME/support/bridge-for-linux")
require.NoError(t, err)
require.Equal(t, index1, index2)
_, err = GetArticleIndex("https://proton.me")
require.ErrorIs(t, err, ErrArticleNotFound)
}
func Test_simplifyUserInput(t *testing.T) {
require.Equal(t, "word1 ñóÄ don't déjà 33 pizza", simplifyUserInput(" \nword1 \n\tñóÄ don't\n\n\ndéjà, 33 pizza=🍕\n,\n"))
}