Skip to content

Commit 521bc4e

Browse files
committed
Name
1 parent 50fbed7 commit 521bc4e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

__tests__/utils/QueryProcessor.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,12 @@ describe("QueryProcessor", () => {
1717
"writer in the English language and the world's pre-eminent dramatist."
1818
));
1919
});
20+
21+
test('should return name', () => {
22+
const query = "What is your name?";
23+
const response: string = QueryProcessor(query);
24+
expect(response).toBe((
25+
"Rohan"
26+
));
27+
})
2028
});

utils/QueryProcessor.tsx

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

10+
if (query.toLowerCase().includes("name")) {
11+
return "Rohan";
12+
}
13+
1014
return "";
1115
}

0 commit comments

Comments
 (0)