mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-03 21:03:48 +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> (cherry picked from commit 6fd57782195c0cc1d9b08e3f6186fdfec23ad694)
This commit is contained in:
parent
0fb2b9c36d
commit
5ae836b5f1
@ -1118,6 +1118,10 @@
|
|||||||
{
|
{
|
||||||
"field": "classification.name",
|
"field": "classification.name",
|
||||||
"boost": 7.0
|
"boost": 7.0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"field": "classification.displayName",
|
||||||
|
"boost": 7.0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aggregations": [
|
"aggregations": [
|
||||||
|
@ -437,3 +437,52 @@ test.fixme('Classification Page', async ({ page }) => {
|
|||||||
).not.toBeVisible();
|
).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