-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: Added locale test suit and delete test suit to sanity folder * chore: updated package-lock file * Added taxonomy import/export support (#112) Co-authored-by: Nadeem <[email protected]> * Validating the object when update the entries with assets (#114) Co-authored-by: Nadeem <[email protected]> --------- Co-authored-by: harshithad0703 <[email protected]> Co-authored-by: harshithad0703 <[email protected]> Co-authored-by: Nadeem <[email protected]>
- Loading branch information
1 parent
6c6f448
commit c77c807
Showing
11 changed files
with
329 additions
and
19 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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Empty file.
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,68 @@ | ||
import { expect } from 'chai' | ||
import { describe, it, setup } from 'mocha' | ||
import { jsonReader } from '../utility/fileOperations/readwrite' | ||
import { environmentCreate, environmentProdCreate } from '../mock/environment.js' | ||
import { contentstackClient } from '../utility/ContentstackClient.js' | ||
|
||
let client = {} | ||
|
||
describe('Delete Environment api Test', () => { | ||
setup(() => { | ||
const user = jsonReader('loggedinuser.json') | ||
client = contentstackClient(user.authtoken) | ||
}) | ||
it('should delete an environment', done => { | ||
makeEnvironment(environmentCreate.environment.name) | ||
.delete() | ||
.then((data) => { | ||
expect(data.notice).to.be.equal('Environment deleted successfully.') | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
|
||
it('should delete the prod environment', done => { | ||
makeEnvironment(environmentProdCreate.environment.name) | ||
.delete() | ||
.then((data) => { | ||
expect(data.notice).to.be.equal('Environment deleted successfully.') | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
}) | ||
|
||
describe('Delete Locale api Test', () => { | ||
setup(() => { | ||
const user = jsonReader('loggedinuser.json') | ||
client = contentstackClient(user.authtoken) | ||
}) | ||
|
||
it('should delete language: Hindi - India', done => { | ||
makeLocale('hi-in') | ||
.delete() | ||
.then((data) => { | ||
expect(data.notice).to.be.equal('Language removed successfully.') | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
|
||
it('should delete language: English - Austria', done => { | ||
makeLocale('en-at') | ||
.delete() | ||
.then((data) => { | ||
expect(data.notice).to.be.equal('Language removed successfully.') | ||
done() | ||
}) | ||
.catch(done) | ||
}) | ||
}) | ||
|
||
function makeEnvironment (uid = null) { | ||
return client.stack({ api_key: process.env.API_KEY }).environment(uid) | ||
} | ||
|
||
function makeLocale (uid = null) { | ||
return client.stack({ api_key: process.env.API_KEY }).locale(uid) | ||
} |
Oops, something went wrong.