From abe68dac9c485756a1672f51c3e6b36225f02cfb Mon Sep 17 00:00:00 2001 From: Brandon Andre Date: Wed, 4 Oct 2023 14:22:28 -0400 Subject: [PATCH] Support #32023 - Test partial search - Removed the "Contains word" option since depending on what's stored it can be confusing what's considered a word. - "Starts with" will now not automatically lowercase the query. - "Starts with" will include the "case_insensitive" as true. - NotEquals should be using term not match, removed the "matchQuery" function. - Removed all partial match/contains word tests and updated snapshots. --- .../__tests__/QueryOperatorSelector.test.tsx | 4 - .../QueryOperatorSelector.test.tsx.snap | 17 ++--- .../QueryBuilderElasticSearchExport.tsx | 25 ++----- .../QueryBuilderElasticSearchExport8.tsx | 25 ++----- .../QueryBuilderElasticSearchExport.test.tsx | 5 -- ...ryBuilderElasticSearchExport.test.tsx.snap | 38 ++++++---- .../QueryBuilderFieldExtensionSearch.tsx | 1 - .../QueryBuilderManagedAttributeSearch.tsx | 1 - .../QueryBuilderTextSearch.tsx | 23 ++---- .../__tests__/QueryBuilderDateSearch.test.tsx | 29 -------- .../QueryBuilderFieldExtensionSearch.test.tsx | 1 - ...ueryBuilderManagedAttributeSearch.test.tsx | 1 - .../QueryBuilderNumberSearch.test.tsx | 29 -------- .../__tests__/QueryBuilderTextSearch.test.tsx | 29 -------- ...yBuilderFieldExtensionSearch.test.tsx.snap | 50 +++---------- ...uilderManagedAttributeSearch.test.tsx.snap | 74 ++++++------------- .../query-builder/useQueryBuilderConfig.tsx | 6 -- packages/dina-ui/intl/dina-ui-en.ts | 1 - packages/dina-ui/intl/dina-ui-fr.ts | 1 - 19 files changed, 86 insertions(+), 274 deletions(-) diff --git a/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/QueryOperatorSelector.test.tsx b/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/QueryOperatorSelector.test.tsx index 68e7416cfa..0f5eba2232 100644 --- a/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/QueryOperatorSelector.test.tsx +++ b/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/QueryOperatorSelector.test.tsx @@ -8,10 +8,6 @@ const OPERATOR_OPTIONS: FieldItems = [ key: "exactMatch", label: "Exact Match" }, - { - key: "partialMatch", - label: "Partial Match" - }, { key: "notEquals", label: "Not Equals" diff --git a/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/__snapshots__/QueryOperatorSelector.test.tsx.snap b/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/__snapshots__/QueryOperatorSelector.test.tsx.snap index 12df7aae2a..d62d910715 100644 --- a/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/__snapshots__/QueryOperatorSelector.test.tsx.snap +++ b/packages/common-ui/lib/list-page/query-builder/query-builder-core-components/__tests__/__snapshots__/QueryOperatorSelector.test.tsx.snap @@ -87,30 +87,23 @@ exports[`QueryOperatorSelector component Snapshot Test 1`] = ` - -