Updated tests
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
ref #193
This commit is contained in:
parent
0636616dad
commit
01ed51489e
|
@ -170,7 +170,7 @@ describe('POST /api/donations/fixed successfully', () => {
|
|||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json")
|
||||
});
|
||||
it('creating a new fixed donation should return 200', async () => {
|
||||
it('creating a new fixed donation with more params should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/donations/fixed', {
|
||||
"donor": added_donor.id,
|
||||
"amount": 1000
|
||||
|
@ -181,6 +181,23 @@ describe('POST /api/donations/fixed successfully', () => {
|
|||
expect(res.data).toEqual({
|
||||
"donor": added_donor,
|
||||
"amount": 1000,
|
||||
"payedAmount": 0,
|
||||
"responseType": "DONATION"
|
||||
});
|
||||
});
|
||||
it('creating a new fixed donation with all params should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/donations/fixed', {
|
||||
"donor": added_donor.id,
|
||||
"amount": 1000,
|
||||
"payedAmount": 1000
|
||||
}, axios_config);
|
||||
delete res.data.id;
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data).toEqual({
|
||||
"donor": added_donor,
|
||||
"amount": 1000,
|
||||
"payedAmount": 1000,
|
||||
"responseType": "DONATION"
|
||||
});
|
||||
});
|
||||
|
@ -219,7 +236,7 @@ describe('POST /api/donations/distance successfully', () => {
|
|||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json")
|
||||
});
|
||||
it('creating a new fixed donation should return 200', async () => {
|
||||
it('creating a new fixed donation with most params should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/donations/distance', {
|
||||
"runner": added_runner.id,
|
||||
"amountPerDistance": 100,
|
||||
|
@ -233,6 +250,26 @@ describe('POST /api/donations/distance successfully', () => {
|
|||
"amountPerDistance": 100,
|
||||
"runner": added_runner,
|
||||
"amount": 0,
|
||||
"payedAmount": 0,
|
||||
"responseType": "DISTANCEDONATION"
|
||||
})
|
||||
});
|
||||
it('creating a new fixed donation with all params should return 200', async () => {
|
||||
const res = await axios.post(base + '/api/donations/distance', {
|
||||
"runner": added_runner.id,
|
||||
"amountPerDistance": 100,
|
||||
"donor": added_donor.id,
|
||||
"payedAmount": 1000
|
||||
}, axios_config);
|
||||
delete res.data.id;
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data).toEqual({
|
||||
"donor": added_donor,
|
||||
"amountPerDistance": 100,
|
||||
"runner": added_runner,
|
||||
"amount": 0,
|
||||
"payedAmount": 1000,
|
||||
"responseType": "DISTANCEDONATION"
|
||||
})
|
||||
});
|
||||
|
|
|
@ -213,6 +213,17 @@ describe('adding + updating fixed donation valid', () => {
|
|||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data.amount).toEqual(42);
|
||||
});
|
||||
it('updating payedAmount should return 200', async () => {
|
||||
const res = await axios.put(base + '/api/donations/fixed/' + added_donation.id, {
|
||||
"id": added_donation.id,
|
||||
"donor": added_donor.id,
|
||||
"amount": 42,
|
||||
"payedAmount": 10
|
||||
}, axios_config);
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data.amount).toEqual(42);
|
||||
});
|
||||
it('updating donor should return 200', async () => {
|
||||
const res = await axios.put(base + '/api/donations/fixed/' + added_donation.id, {
|
||||
"id": added_donation.id,
|
||||
|
@ -317,6 +328,19 @@ describe('adding + updating distance donation valid', () => {
|
|||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data.amountPerDistance).toEqual(69);
|
||||
});
|
||||
it('updating payedAmount should return 200', async () => {
|
||||
const res = await axios.put(base + '/api/donations/distance/' + added_donation.id, {
|
||||
"id": added_donation.id,
|
||||
"runner": added_runner.id,
|
||||
"amountPerDistance": 69,
|
||||
"donor": added_donor.id,
|
||||
"payedAmount": 10
|
||||
}, axios_config);
|
||||
delete res.data.donor.donationAmount;
|
||||
expect(res.status).toEqual(200);
|
||||
expect(res.headers['content-type']).toContain("application/json");
|
||||
expect(res.data.amountPerDistance).toEqual(69);
|
||||
});
|
||||
it('updating runner should return 200', async () => {
|
||||
const res = await axios.put(base + '/api/donations/distance/' + added_donation.id, {
|
||||
"id": added_donation.id,
|
||||
|
|
Loading…
Reference in New Issue