Skip to content

Commit 3af0d13

Browse files
reorder test suites
1 parent e50d1ae commit 3af0d13

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

test/sanity-check/api/stack-test.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { expect } from 'chai'
22
import { describe, it, setup } from 'mocha'
33
import { jsonReader, jsonWrite } from '../utility/fileOperations/readwrite'
44
import { contentstackClient } from '../utility/ContentstackClient.js'
5-
import { stageBranch } from '../mock/branch.js'
65

76
import dotenv from 'dotenv'
87
dotenv.config()
@@ -168,29 +167,3 @@ describe('Stack api Test', () => {
168167
.catch(done)
169168
})
170169
})
171-
172-
describe('Branch creation api Test', () => {
173-
setup(() => {
174-
const user = jsonReader('loggedinuser.json')
175-
client = contentstackClient(user.authtoken)
176-
})
177-
178-
it('should create staging branch', done => {
179-
makeBranch()
180-
.create({ branch: stageBranch })
181-
.then((response) => {
182-
expect(response.uid).to.be.equal(stageBranch.uid)
183-
expect(response.urlPath).to.be.equal(`/stacks/branches/${stageBranch.uid}`)
184-
expect(response.source).to.be.equal(stageBranch.source)
185-
expect(response.alias).to.not.equal(undefined)
186-
expect(response.delete).to.not.equal(undefined)
187-
expect(response.fetch).to.not.equal(undefined)
188-
done()
189-
})
190-
.catch(done)
191-
})
192-
})
193-
194-
function makeBranch (uid = null) {
195-
return client.stack({ api_key: process.env.API_KEY }).branch(uid)
196-
}

test/sanity-check/api/terms-test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, it, beforeEach } from 'mocha'
22
import { expect } from 'chai'
33
import { jsonReader } from '../utility/fileOperations/readwrite'
44
import { contentstackClient } from '../utility/ContentstackClient.js'
5+
import { stageBranch } from '../mock/branch.js'
56

67
var client = {}
78

@@ -172,3 +173,29 @@ describe('Terms API Test', () => {
172173
function makeTerms (taxonomyUid, termUid = null) {
173174
return client.stack({ api_key: process.env.API_KEY }).taxonomy(taxonomyUid).terms(termUid)
174175
}
176+
177+
describe('Branch creation api Test', () => {
178+
beforeEach(() => {
179+
const user = jsonReader('loggedinuser.json')
180+
client = contentstackClient(user.authtoken)
181+
})
182+
183+
it('should create staging branch', done => {
184+
makeBranch()
185+
.create({ branch: stageBranch })
186+
.then((response) => {
187+
expect(response.uid).to.be.equal(stageBranch.uid)
188+
expect(response.urlPath).to.be.equal(`/stacks/branches/${stageBranch.uid}`)
189+
expect(response.source).to.be.equal(stageBranch.source)
190+
expect(response.alias).to.not.equal(undefined)
191+
expect(response.delete).to.not.equal(undefined)
192+
expect(response.fetch).to.not.equal(undefined)
193+
done()
194+
})
195+
.catch(done)
196+
})
197+
})
198+
199+
function makeBranch (uid = null) {
200+
return client.stack({ api_key: process.env.API_KEY }).branch(uid)
201+
}

0 commit comments

Comments
 (0)