From a084d8b1009ff95810bdf617c4a127c79f38c5f6 Mon Sep 17 00:00:00 2001 From: Mohammad Date: Sun, 1 Oct 2023 12:23:01 +0300 Subject: [PATCH] Added functionality for the andrew id, that returns mannan --- __tests__/utils/QueryProcessor.test.ts | 7 +++++++ utils/QueryProcessor.tsx | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/__tests__/utils/QueryProcessor.test.ts b/__tests__/utils/QueryProcessor.test.ts index 218834c4..54ac498b 100644 --- a/__tests__/utils/QueryProcessor.test.ts +++ b/__tests__/utils/QueryProcessor.test.ts @@ -17,4 +17,11 @@ describe("QueryProcessor", () => { "writer in the English language and the world's pre-eminent dramatist." )); }); + test('should return andrew id description', () => { + const query = "What is your Andrew ID?"; + const response: string = QueryProcessor(query); + expect(response).toBe(( + "mannan" + )); + }); }); \ No newline at end of file diff --git a/utils/QueryProcessor.tsx b/utils/QueryProcessor.tsx index 857767f9..39fda49a 100644 --- a/utils/QueryProcessor.tsx +++ b/utils/QueryProcessor.tsx @@ -5,6 +5,13 @@ export default function QueryProcessor(query: string): string { "English poet, playwright, and actor, widely regarded as the greatest " + "writer in the English language and the world's pre-eminent dramatist." ); + + } + if (query.toLowerCase().includes("andrew")) { + return ( + "mannan" + ); + } return "";