Skip to content

Commit 2af26e4

Browse files
committed
added andrew id query and testing
1 parent 521bc4e commit 2af26e4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

__tests__/utils/QueryProcessor.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ describe("QueryProcessor", () => {
2525
"Rohan"
2626
));
2727
})
28+
29+
30+
test('should return andrew id', () => {
31+
const query = "What is your andrew id?";
32+
const response: string = QueryProcessor(query);
33+
expect(response).toBe((
34+
"mmingus"
35+
))
36+
})
2837
});

utils/QueryProcessor.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ export default function QueryProcessor(query: string): string {
77
);
88
}
99

10+
if (query.toLowerCase().includes("what is your andrew id?")) {
11+
return "mmingus";
12+
}
13+
1014
if (query.toLowerCase().includes("name")) {
1115
return "Rohan";
1216
}

0 commit comments

Comments
 (0)