Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions __tests__/utils/QueryProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ describe("QueryProcessor", () => {
const query = "What is your name?";
const response: string = QueryProcessor(query);
expect(response).toBe((
"Rohan"
"jerryc2"
));
})
});

test('should return Andrew ID', () => {
const query = "What is your Andrew ID?";
const response: string = QueryProcessor(query);
expect(response).toBe("jerryc2");
});
});
7 changes: 5 additions & 2 deletions utils/QueryProcessor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ export default function QueryProcessor(query: string): string {
);
}

if (query.toLowerCase().includes("name")) {
return "Rohan";
if (query.toLowerCase().includes("andrew id")) {
return "jerryc2";
}

if (query.toLowerCase().includes("name")) {
return "jerryc2";
}
return "";
}