forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: SuZhou-Joe <[email protected]>
- Loading branch information
1 parent
73fe409
commit fb2b21e
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import expect from '@osd/expect'; | ||
import { WorkspaceAttribute } from 'opensearch-dashboards/server'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
const testWorkspace: WorkspaceAttribute = { | ||
id: 'fake_id', | ||
name: 'test_workspace', | ||
description: 'test_workspace_description', | ||
}; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const opensearch = getService('legacyOpenSearch'); | ||
|
||
const MILLISECOND_IN_WEEK = 1000 * 60 * 60 * 24 * 7; | ||
|
||
describe('Workspace CRUD apis', () => { | ||
it('basic CRUD', async () => { | ||
const resp = await supertest | ||
.post(`/api/workspaces`) | ||
.set('osd-xsrf', 'opensearch-dashboards') | ||
.send( | ||
JSON.stringify({ | ||
attributes: testWorkspace, | ||
}) | ||
) | ||
.expect(200); | ||
|
||
expect(resp.body).to.be.an('array'); | ||
expect(resp.body.length).to.be.above(0); | ||
expect(resp.body[0].status).to.be('not_installed'); | ||
}); | ||
}); | ||
} |