mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 04:14:34 +00:00
fix glossary term selection (#16303)
* fix glossary term selection * fix flaky tags cypress
This commit is contained in:
parent
9747315522
commit
46e14b79f4
@ -95,13 +95,13 @@ export const removeGlossaryTerm = (
|
||||
'[data-testid="entity-right-panel"] [data-testid="glossary-container"] [data-testid="edit-button"]'
|
||||
).click();
|
||||
|
||||
verifyResponseStatusCode('@fetchGlossaries', 200);
|
||||
|
||||
// Remove all added tags
|
||||
cy.get(
|
||||
`[data-testid="selected-tag-${glossaryTerm}"] [data-testid="remove-tags"]`
|
||||
).click();
|
||||
|
||||
verifyResponseStatusCode('@fetchGlossaries', 200);
|
||||
|
||||
cy.get('[data-testid="saveAssociatedTag"]').click();
|
||||
verifyResponseStatusCode('@removeTags', 200, {
|
||||
requestTimeout: 15000,
|
||||
|
@ -93,11 +93,12 @@ export const removeTags = (
|
||||
.scrollIntoView()
|
||||
.click();
|
||||
|
||||
verifyResponseStatusCode('@searchTags', 200);
|
||||
|
||||
// Remove all added tags
|
||||
cy.get(
|
||||
`[data-testid="selected-tag-${tag}"] [data-testid="remove-tags"]`
|
||||
).click();
|
||||
verifyResponseStatusCode('@searchTags', 200);
|
||||
|
||||
cy.get('[data-testid="saveAssociatedTag"]').click();
|
||||
verifyResponseStatusCode('@removeTags', 200, {
|
||||
|
@ -124,33 +124,35 @@ describe('Search Index Application', { tags: 'Settings' }, () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('Run application', () => {
|
||||
interceptURL(
|
||||
'GET',
|
||||
'/api/v1/apps/name/SearchIndexingApplication?fields=*',
|
||||
'getSearchIndexingApplication'
|
||||
);
|
||||
interceptURL(
|
||||
'POST',
|
||||
'/api/v1/apps/trigger/SearchIndexingApplication',
|
||||
'triggerPipeline'
|
||||
);
|
||||
cy.get(
|
||||
'[data-testid="search-indexing-application-card"] [data-testid="config-btn"]'
|
||||
).click();
|
||||
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
||||
cy.get('[data-testid="run-now-button"]').click();
|
||||
verifyResponseStatusCode('@triggerPipeline', 200);
|
||||
if (Cypress.env('isOss')) {
|
||||
it('Run application', () => {
|
||||
interceptURL(
|
||||
'GET',
|
||||
'/api/v1/apps/name/SearchIndexingApplication?fields=*',
|
||||
'getSearchIndexingApplication'
|
||||
);
|
||||
interceptURL(
|
||||
'POST',
|
||||
'/api/v1/apps/trigger/SearchIndexingApplication',
|
||||
'triggerPipeline'
|
||||
);
|
||||
cy.get(
|
||||
'[data-testid="search-indexing-application-card"] [data-testid="config-btn"]'
|
||||
).click();
|
||||
verifyResponseStatusCode('@getSearchIndexingApplication', 200);
|
||||
cy.get('[data-testid="run-now-button"]').click();
|
||||
verifyResponseStatusCode('@triggerPipeline', 200);
|
||||
|
||||
cy.wait(120000); // waiting for 2 minutes before we check if reindex was success
|
||||
cy.wait(120000); // waiting for 2 minutes before we check if reindex was success
|
||||
|
||||
interceptURL(
|
||||
'GET',
|
||||
'/api/v1/apps/name/SearchIndexingApplication/status?offset=0&limit=1',
|
||||
'lastExecutionRun'
|
||||
);
|
||||
interceptURL(
|
||||
'GET',
|
||||
'/api/v1/apps/name/SearchIndexingApplication/status?offset=0&limit=1',
|
||||
'lastExecutionRun'
|
||||
);
|
||||
|
||||
cy.reload();
|
||||
verifyLastExecutionRun('lastExecutionRun');
|
||||
});
|
||||
cy.reload();
|
||||
verifyLastExecutionRun('lastExecutionRun');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -183,7 +183,13 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
|
||||
value: string;
|
||||
}[]
|
||||
) => {
|
||||
const lastSelectedMap = new Map(
|
||||
selectedTagsRef.current.map((tag) => [tag.value, tag])
|
||||
);
|
||||
const selectedValues = values.map(({ value }) => {
|
||||
if (lastSelectedMap.has(value)) {
|
||||
return lastSelectedMap.get(value) as SelectOption;
|
||||
}
|
||||
const initialData = findGlossaryTermByFqn(
|
||||
[
|
||||
...glossaries,
|
||||
|
Loading…
x
Reference in New Issue
Block a user