Skip to content

Commit 6d87d02

Browse files
author
Vikas Agarwal
committed
git#651-Return BA status in the GET billing account endpoint
— fixing unit test
1 parent 9767428 commit 6d87d02

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/routes/billingAccounts/get.spec.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,6 @@ describe('Project Billing Accounts list', () => {
114114
.expect(403, done);
115115
});
116116

117-
it('should return 403 for admin', (done) => {
118-
request(server)
119-
.get(`/v5/projects/${project1.id}/billingAccount`)
120-
.set({
121-
Authorization: `Bearer ${testUtil.jwts.admin}`,
122-
})
123-
.send()
124-
.expect(403, done);
125-
});
126-
127117
it('should return 404 if the project is not found', (done) => {
128118
request(server)
129119
.get('/v5/projects/11223344/billingAccount')
@@ -163,5 +153,26 @@ describe('Project Billing Accounts list', () => {
163153
}
164154
});
165155
});
156+
157+
it('should return billing account details using user token but without markup field',
158+
(done) => {
159+
request(server)
160+
.get(`/v5/projects/${project1.id}/billingAccount`)
161+
.set({
162+
Authorization: `Bearer ${testUtil.jwts.admin}`,
163+
})
164+
.send()
165+
.expect(200)
166+
.end((err, res) => {
167+
if (err) {
168+
done(err);
169+
} else {
170+
const resJson = res.body;
171+
resJson.tcBillingAccountId.should.be.eql(billingAccountData.tcBillingAccountId);
172+
resJson.markup.should.not.exist;
173+
done();
174+
}
175+
});
176+
});
166177
});
167178
});

0 commit comments

Comments
 (0)