Skip to content

Commit

Permalink
add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
yubonluo committed Mar 13, 2024
1 parent 6863eb5 commit a7a39d6
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { BASE_PATH } from '../../../utils/constants';

if (Cypress.env('DASHBOARDS_WORKSPACE_ENABLED')) {
describe('Workspace CRUD APIs', () => {
describe('Create a workspace', () => {
it('should successfully create a worksapce', () => {
const body = {
attributes: {
name: 'test_workspace',
description: 'test_workspace_description',
},
};
cy.request({
method: 'POST',
url: `${BASE_PATH}/api/workspaces`,
headers: {
'osd-xsrf': true,
},
body: body,
}).as('createWorkspace');
cy.get('@createWorkspace').should((res) => {
expect(res.body.success).to.eql(true);
});
});
});
});
}

0 comments on commit a7a39d6

Please sign in to comment.