MINOR: Fix the query of domain in explore (#14297)

* Fix the query of domian in exolore

* added cypress test

* minor change in url

* minor change
This commit is contained in:
Ashish Gupta 2023-12-08 13:13:19 +05:30 committed by GitHub
parent 8feb85e245
commit e59fffc2f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 3 deletions

View File

@ -13,6 +13,7 @@
// eslint-disable-next-line spaced-comment
/// <reference types="Cypress" />
import { interceptURL, verifyResponseStatusCode } from '../../common/common';
import {
addAssetsToDataProduct,
addAssetsToDomain,
@ -88,6 +89,26 @@ describe('Domain page should work properly', () => {
addAssetsToDataProduct(DOMAIN_3.dataProducts[0], DOMAIN_3);
});
it('Switch domain from navbar and check domain query call warp in quotes', () => {
cy.get('[data-testid="domain-dropdown"]').should('be.visible').click();
cy.get(
`[data-menu-id*="${DOMAIN_3.name}"] > .ant-dropdown-menu-title-content`
)
.should('be.visible')
.click();
interceptURL(
'GET',
'/api/v1/search/query?q=%28domain.fullyQualifiedName%3A%22Cypress%20Space%22%29*',
'tableSearchQuery'
);
cy.get('[data-testid="app-bar-item-explore"]').click();
verifyResponseStatusCode('@tableSearchQuery', 200);
});
it('Remove data product assets using asset selection modal should work properly', () => {
removeAssetsFromDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2);
});

View File

@ -435,9 +435,9 @@ export const AuthProvider = ({
// Parse and update the query parameter
const queryParams = Qs.parse(config.url.split('?')[1]);
// adding quotes for exact matching
const domainStatement = `(domain.fullyQualifiedName:${escapeESReservedCharacters(
const domainStatement = `(domain.fullyQualifiedName:"${escapeESReservedCharacters(
activeDomain
)})`;
)}")`;
queryParams.q = queryParams.q ?? '';
queryParams.q += isEmpty(queryParams.q)
? domainStatement

View File

@ -443,7 +443,7 @@ const NavBar = ({
}}
placement="bottomRight"
trigger={['click']}>
<Row gutter={6}>
<Row data-testid="domain-dropdown" gutter={6}>
<Col className="flex-center">
<DomainIcon
className="d-flex text-base-color"