From a06f04bf94bdf37e90de73216fbc12154ed0186b Mon Sep 17 00:00:00 2001 From: Kapian1234 Date: Wed, 13 Nov 2024 17:45:15 +0800 Subject: [PATCH] Optimize the condition check Signed-off-by: Kapian1234 --- .../mds_workspace_create.spec.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js index d4fa1dbea..c133bdc65 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_create.spec.js @@ -170,24 +170,24 @@ if (Cypress.env('WORKSPACE_ENABLED')) { }); } - if (MDSEnabled) { - it('should correctly display the summary card', () => { - inputWorkspaceName(workspaceName); - cy.getElementByTestId( - 'workspaceForm-workspaceDetails-descriptionInputText' - ).type('test_workspace_description.+~!'); - cy.getElementByTestId('workspaceUseCase-essentials').click({ - force: true, - }); - inputDataSourceWhenMDSEnabled(dataSourceTitle); - cy.get('.workspaceCreateRightSidebar').within(() => { - cy.contains(workspaceName).should('exist'); - cy.contains('test_workspace_description.+~!').should('exist'); - cy.contains('Essentials').should('exist'); + it('should correctly display the summary card', () => { + inputWorkspaceName(workspaceName); + cy.getElementByTestId( + 'workspaceForm-workspaceDetails-descriptionInputText' + ).type('test_workspace_description.+~!'); + cy.getElementByTestId('workspaceUseCase-essentials').click({ + force: true, + }); + inputDataSourceWhenMDSEnabled(dataSourceTitle); + cy.get('.workspaceCreateRightSidebar').within(() => { + cy.contains(workspaceName).should('exist'); + cy.contains('test_workspace_description.+~!').should('exist'); + cy.contains('Essentials').should('exist'); + if (MDSEnabled) { cy.contains(dataSourceTitle).should('exist'); - }); + } }); - } + }); }); describe('Validate workspace name and description', () => {