mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-06-27 04:22:05 +00:00
* Fix #21653 - Tag search based on displayName * added test * update test to search by classification display name --------- Co-authored-by: shrushti2000 <shrushtipolekar@gmail.com>
This commit is contained in:
parent
66d2ef2c8b
commit
6fd5778219
@ -1118,6 +1118,10 @@
|
||||
{
|
||||
"field": "classification.name",
|
||||
"boost": 7.0
|
||||
},
|
||||
{
|
||||
"field": "classification.displayName",
|
||||
"boost": 7.0
|
||||
}
|
||||
],
|
||||
"aggregations": [
|
||||
|
@ -437,3 +437,52 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test('Search tag using classification display name should work', async ({
|
||||
page,
|
||||
}) => {
|
||||
const displayNameToSearch = tag.responseData.classification.displayName;
|
||||
|
||||
await table.visitEntityPage(page);
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const initialQueryResponse = page.waitForResponse('**/api/v1/search/query?*');
|
||||
|
||||
await page
|
||||
.getByTestId('KnowledgePanel.Tags')
|
||||
.getByTestId('tags-container')
|
||||
.getByTestId('add-tag')
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await initialQueryResponse;
|
||||
|
||||
const tagSearchResponse = page.waitForResponse(
|
||||
`/api/v1/search/query?q=*${encodeURIComponent(displayNameToSearch)}*`
|
||||
);
|
||||
|
||||
// Enter the display name in the search box
|
||||
await page.fill('[data-testid="tag-selector"] input', displayNameToSearch);
|
||||
|
||||
const response = await tagSearchResponse;
|
||||
const searchResults = await response.json();
|
||||
|
||||
// Verify that we got search results
|
||||
expect(searchResults.hits.hits.length).toBeGreaterThan(0);
|
||||
|
||||
// Verify that the classification display name is shown in search input
|
||||
await expect(
|
||||
page.locator('[data-testid="tag-selector"] > .ant-select-selector')
|
||||
).toContainText(displayNameToSearch);
|
||||
|
||||
// Verify that the tag with matching display name is shown in dropdown
|
||||
await expect(
|
||||
page.locator('.ant-select-dropdown').getByText(tag.responseData.displayName)
|
||||
).toBeVisible();
|
||||
|
||||
// Verify the tag is selectable in the dropdown
|
||||
await expect(
|
||||
page.getByTestId(`tag-${tag.responseData.fullyQualifiedName}`)
|
||||
).toBeVisible();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user