fix cypress for dataModelVersionPage (#16715)

This commit is contained in:
Ashish Gupta 2024-06-19 19:45:56 +05:30 committed by GitHub
parent 6b7e9238f7
commit 25efd7641e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,12 +69,20 @@ export const addOwner = (
dataTestId?: string, dataTestId?: string,
verifyPatchResponse = true verifyPatchResponse = true
) => { ) => {
interceptURL(
'GET',
'/api/v1/search/query?q=*&index=team_search_index*',
'getTeams'
);
interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers'); interceptURL('GET', '/api/v1/users?*isBot=false*', 'getUsers');
cy.get('[data-testid="edit-owner"]') cy.get('[data-testid="edit-owner"]')
.scrollIntoView() .scrollIntoView()
.click({ waitForAnimations: false }); .click({ waitForAnimations: false });
cy.get("[data-testid='select-owner-tabs']").should('be.visible'); cy.get("[data-testid='select-owner-tabs']").should('be.visible');
verifyResponseStatusCode('@getTeams', 200); // wait for teams to load before switching the tab
cy.get('.ant-tabs [id*=tab-users]') cy.get('.ant-tabs [id*=tab-users]')
.scrollIntoView() .scrollIntoView()
.click({ waitForAnimations: false }); .click({ waitForAnimations: false });