Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

test(nocodb-sdk): update QueryFilterParser unit test

Ramesh Manede9757b701fe
diff --git a/packages/nocodb-sdk/src/lib/parser/queryFilter/query-filter-parser.spec.ts b/packages/nocodb-sdk/src/lib/parser/queryFilter/query-filter-parser.spec.ts
index 7a8b540015..1fc9d8a53d 100644
--- a/packages/nocodb-sdk/src/lib/parser/queryFilter/query-filter-parser.spec.ts
+++ b/packages/nocodb-sdk/src/lib/parser/queryFilter/query-filter-parser.spec.ts
@@ -243,13 +243,11 @@ describe('query-filter-parser', () => {
it(`will error when and/or operation is wrong`, async () => {
expect.hasAssertions();
const text = `(fSingleLineText,eq,"sample,text")or(fSingleLineText,eq,"sample text")`;
- try {
- QueryFilterParser.parse(text);
- } catch (ex) {
- expect(ex.message).toBe(
- `Invalid filter expression. Expected a valid logical operator like '~or' or '~and', but found 'or'`
- );
- }
+ const result = QueryFilterParser.parse(text);
+ const message = parseParsingError(result.parseErrors[0]);
+ expect(message).toBe(
+ `Invalid filter expression. Expected a valid logical operator like '~or' or '~and', but found 'or'`
+ );
});
it(`will handle parsing error when operation is wrong`, async () => {
const text = `(fSingleLineText,noneInOperation,"sample,text")`;