Compare commits
2 Commits
01ed51489e
...
30c6d3d8db
Author | SHA1 | Date | |
---|---|---|---|
30c6d3d8db | |||
6c14ed9c89 |
@ -182,6 +182,7 @@ describe('POST /api/donations/fixed successfully', () => {
|
|||||||
"donor": added_donor,
|
"donor": added_donor,
|
||||||
"amount": 1000,
|
"amount": 1000,
|
||||||
"payedAmount": 0,
|
"payedAmount": 0,
|
||||||
|
"status": "OPEN",
|
||||||
"responseType": "DONATION"
|
"responseType": "DONATION"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -198,6 +199,7 @@ describe('POST /api/donations/fixed successfully', () => {
|
|||||||
"donor": added_donor,
|
"donor": added_donor,
|
||||||
"amount": 1000,
|
"amount": 1000,
|
||||||
"payedAmount": 1000,
|
"payedAmount": 1000,
|
||||||
|
"status": "PAYED",
|
||||||
"responseType": "DONATION"
|
"responseType": "DONATION"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -236,7 +238,7 @@ describe('POST /api/donations/distance successfully', () => {
|
|||||||
expect(res.status).toEqual(200);
|
expect(res.status).toEqual(200);
|
||||||
expect(res.headers['content-type']).toContain("application/json")
|
expect(res.headers['content-type']).toContain("application/json")
|
||||||
});
|
});
|
||||||
it('creating a new fixed donation with most params should return 200', async () => {
|
it('creating a new distance donation with most params should return 200', async () => {
|
||||||
const res = await axios.post(base + '/api/donations/distance', {
|
const res = await axios.post(base + '/api/donations/distance', {
|
||||||
"runner": added_runner.id,
|
"runner": added_runner.id,
|
||||||
"amountPerDistance": 100,
|
"amountPerDistance": 100,
|
||||||
@ -251,10 +253,11 @@ describe('POST /api/donations/distance successfully', () => {
|
|||||||
"runner": added_runner,
|
"runner": added_runner,
|
||||||
"amount": 0,
|
"amount": 0,
|
||||||
"payedAmount": 0,
|
"payedAmount": 0,
|
||||||
|
"status": "PAYED",
|
||||||
"responseType": "DISTANCEDONATION"
|
"responseType": "DISTANCEDONATION"
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
it('creating a new fixed donation with all params should return 200', async () => {
|
it('creating a new distance donation with all params should return 200', async () => {
|
||||||
const res = await axios.post(base + '/api/donations/distance', {
|
const res = await axios.post(base + '/api/donations/distance', {
|
||||||
"runner": added_runner.id,
|
"runner": added_runner.id,
|
||||||
"amountPerDistance": 100,
|
"amountPerDistance": 100,
|
||||||
@ -270,6 +273,7 @@ describe('POST /api/donations/distance successfully', () => {
|
|||||||
"runner": added_runner,
|
"runner": added_runner,
|
||||||
"amount": 0,
|
"amount": 0,
|
||||||
"payedAmount": 1000,
|
"payedAmount": 1000,
|
||||||
|
"status": "PAYED",
|
||||||
"responseType": "DISTANCEDONATION"
|
"responseType": "DISTANCEDONATION"
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -222,7 +222,7 @@ describe('adding + updating fixed donation valid', () => {
|
|||||||
}, axios_config);
|
}, axios_config);
|
||||||
expect(res.status).toEqual(200);
|
expect(res.status).toEqual(200);
|
||||||
expect(res.headers['content-type']).toContain("application/json");
|
expect(res.headers['content-type']).toContain("application/json");
|
||||||
expect(res.data.amount).toEqual(42);
|
expect(res.data.payedAmount).toEqual(10);
|
||||||
});
|
});
|
||||||
it('updating donor should return 200', async () => {
|
it('updating donor should return 200', async () => {
|
||||||
const res = await axios.put(base + '/api/donations/fixed/' + added_donation.id, {
|
const res = await axios.put(base + '/api/donations/fixed/' + added_donation.id, {
|
||||||
@ -339,7 +339,7 @@ describe('adding + updating distance donation valid', () => {
|
|||||||
delete res.data.donor.donationAmount;
|
delete res.data.donor.donationAmount;
|
||||||
expect(res.status).toEqual(200);
|
expect(res.status).toEqual(200);
|
||||||
expect(res.headers['content-type']).toContain("application/json");
|
expect(res.headers['content-type']).toContain("application/json");
|
||||||
expect(res.data.amountPerDistance).toEqual(69);
|
expect(res.data.payedAmount).toEqual(10);
|
||||||
});
|
});
|
||||||
it('updating runner should return 200', async () => {
|
it('updating runner should return 200', async () => {
|
||||||
const res = await axios.put(base + '/api/donations/distance/' + added_donation.id, {
|
const res = await axios.put(base + '/api/donations/distance/' + added_donation.id, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user