@@ -12,31 +12,30 @@ describe('Branch api Test', () => {
1212 client = contentstackClient ( user . authtoken )
1313 } )
1414
15- it ( 'should return master branch when query is called ' , done => {
15+ it ( 'should create Branch from staging ' , done => {
1616 makeBranch ( )
17- . query ( )
18- . find ( )
17+ . create ( { branch : devBranch } )
1918 . then ( ( response ) => {
20- expect ( response . items . length ) . to . be . equal ( 1 )
21- var item = response . items [ 0 ]
22- expect ( item . urlPath ) . to . be . equal ( `/stacks/branches/${ item . uid } ` )
23- expect ( item . delete ) . to . not . equal ( undefined )
24- expect ( item . fetch ) . to . not . equal ( undefined )
19+ expect ( response . uid ) . to . be . equal ( devBranch . uid )
20+ expect ( response . urlPath ) . to . be . equal ( `/stacks/branches/${ devBranch . uid } ` )
21+ expect ( response . source ) . to . be . equal ( devBranch . source )
22+ expect ( response . alias ) . to . not . equal ( undefined )
23+ expect ( response . delete ) . to . not . equal ( undefined )
24+ expect ( response . fetch ) . to . not . equal ( undefined )
2525 done ( )
2626 } )
2727 . catch ( done )
2828 } )
2929
30- it ( 'should create staging branch' , done => {
30+ it ( 'should return master branch when query is called ' , done => {
3131 makeBranch ( )
32- . create ( { branch : stageBranch } )
32+ . query ( )
33+ . find ( )
3334 . then ( ( response ) => {
34- expect ( response . uid ) . to . be . equal ( stageBranch . uid )
35- expect ( response . urlPath ) . to . be . equal ( `/stacks/branches/${ stageBranch . uid } ` )
36- expect ( response . source ) . to . be . equal ( stageBranch . source )
37- expect ( response . alias ) . to . not . equal ( undefined )
38- expect ( response . delete ) . to . not . equal ( undefined )
39- expect ( response . fetch ) . to . not . equal ( undefined )
35+ var item = response . items [ 0 ]
36+ expect ( item . urlPath ) . to . be . equal ( `/stacks/branches/${ item . uid } ` )
37+ expect ( item . delete ) . to . not . equal ( undefined )
38+ expect ( item . fetch ) . to . not . equal ( undefined )
4039 done ( )
4140 } )
4241 . catch ( done )
@@ -72,21 +71,6 @@ describe('Branch api Test', () => {
7271 . catch ( done )
7372 } )
7473
75- it ( 'should create Branch from staging' , done => {
76- makeBranch ( )
77- . create ( { branch : devBranch } )
78- . then ( ( response ) => {
79- expect ( response . uid ) . to . be . equal ( devBranch . uid )
80- expect ( response . urlPath ) . to . be . equal ( `/stacks/branches/${ devBranch . uid } ` )
81- expect ( response . source ) . to . be . equal ( devBranch . source )
82- expect ( response . alias ) . to . not . equal ( undefined )
83- expect ( response . delete ) . to . not . equal ( undefined )
84- expect ( response . fetch ) . to . not . equal ( undefined )
85- done ( )
86- } )
87- . catch ( done )
88- } )
89-
9074 it ( 'should query branch for specific condition' , done => {
9175 makeBranch ( )
9276 . query ( { query : { source : 'main' } } )
0 commit comments