refactor inputs
This commit is contained in:
1 parent
2c5d64ab86
commit
549f52655b
45 files changed
+301
-256
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { computeSimilarity } from "./InputAutoComplete";
|
||||
|
||||
test("similarity score", () => {
|
||||
const searchTerms = [
|
||||
"lught",
|
||||
"light",
|
||||
"light balcn",
|
||||
"light bal",
|
||||
"light balcony",
|
||||
"Balcony lig",
|
||||
].map((x) => computeSimilarity(x, "light.balcony", "Balcony Light"));
|
||||
expect(searchTerms).toStrictEqual(searchTerms.sort());
|
||||
});
|
||||
|
||||
test("similarity score #2", () => {
|
||||
expect(
|
||||
computeSimilarity(
|
||||
"li",
|
||||
"6592b3d6d05d3de6fa26c3dbd2edecc2",
|
||||
"Balcony Lights"
|
||||
)
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
Reference in new issue
Block a user