viraxslot / online-school-app

Backend for testing purposes.
0 stars 0 forks source link

Multiple course material with same "order no" after using patch request #75

Open BeatBioInfo opened 2 years ago

BeatBioInfo commented 2 years ago

Steps to reproduce Create a collection on Postman Click on the “add request” button Use the POST method to call a request http://qa-school-test-api.quantori.academy/api/v1/session Enter the following “string” in the “Body” in the following order

{
“username”: “admin”,
“password”: “1234”
}

Press the “send” button to generate an “accessToken”. Click “Add request” to call a 'all materials within a course'. Use the GET method to call a request {{Host}}api/v1/courses/3093/materials. Empty body string Then send the request.

Actual behavior Status code: 200 Test request:

pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Response time is less than 1000ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(1000);
});

pm.test("Successful POST request", function () {
    pm.expect(pm.response.code).to.be.oneOf([200]);
});

Expected behavior PASS: Status code is 200 PASS: Response time is less than 1000ms PASS: GET request Body: Displayed all created course materials specific to a course (3093)

** Course should be displayed in order regardless of when they are created.

Screenshots If applicable, add screenshots to help explain your problem. image image

viraxslot commented 2 years ago

@BeatBioInfo sorry, I don't understand this bug. Could you please provide more information? What's wrong with actual behavior?

BeatBioInfo commented 2 years ago

@viraxslot Thanks for your feedback. I would expect that each course material has a specified order number within a course. Using the above image as an illustration, "id: 163 and id: 166" should be in sequential order after updating the course material i.e., "order": 1 and "order": 2 respectively. I think it should be impossible to assign the same order no to different course materials unless the order is insignificant.