{"info":{"_postman_id":"fe1afc83-a499-4bae-b495-5cda382fb38a","name":"Blog Application","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"19954195","collectionId":"fe1afc83-a499-4bae-b495-5cda382fb38a","publishedId":"2sA2rAyhgB","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-02-22T04:01:45.000Z"},"item":[{"name":"Authentication","item":[{"name":"User Registration","event":[{"listen":"test","script":{"id":"c748257c-4a2c-4b67-a29c-68ab2fb96ad5","exec":["pm.test(\"Response status code is 400\", function () {","  pm.expect(pm.response.code).to.equal(400);","});","","","pm.test(\"Response has the required fields - success and message\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.success).to.exist.and.to.be.a('boolean');","  pm.expect(responseData.message).to.exist.and.to.be.a('string');","});","","","pm.test(\"Success is a boolean value\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.success).to.exist.and.to.be.a('boolean');","});","","","pm.test(\"The message is a non-empty string\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData.message).to.exist.and.to.be.a('string');","    pm.expect(responseData.message).to.not.be.empty;","});","","","pm.test(\"Content-Type header is 'application/json'\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.equal(\"application/json\");","});"],"type":"text/javascript"}}],"id":"370f8766-ee15-4242-812d-b6b93dcacc10","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Abu Said\",\r\n    \"email\": \"abusaidriyaz@gmail.com\",\r\n    \"password\": \"12345678\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/registration","urlObject":{"protocol":"http","port":"4000","path":["api","auth","registration"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"a01049b4-4be1-4e18-81a5-1a4a413d9a41","name":"Registration","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Abu Said\",\r\n    \"email\": \"abusaidriyaz@gmail.com\",\r\n    \"password\": \"12345678\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/registration"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"471"},{"key":"ETag","value":"W/\"1d7-EaAalPqkzVxwhPlzYK+LezMRDR8\""},{"key":"Date","value":"Sun, 18 Feb 2024 18:10:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User registration successfully!\",\n    \"user\": {\n        \"id\": 4,\n        \"createdAt\": \"2024-02-18T18:10:11.110Z\",\n        \"updatedAt\": \"2024-02-18T18:10:11.110Z\",\n        \"name\": \"Abu Said\",\n        \"email\": \"abusaidriyaz@gmail.com\",\n        \"password\": \"$2b$10$9bn8WIcjmw/5cyUaDOnS3.7qQCtkpinR2qAsnnyhpD9Gl68Q0Nsvy\"\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NCwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4Mjc5ODExLCJleHAiOjE3MDgzNjYyMTF9.Ula8In2QBAvLPM79AMLs12HS_VrKPWUZn7lflzKIN_c\"\n}"}],"_postman_id":"370f8766-ee15-4242-812d-b6b93dcacc10"},{"name":"User Login","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Response has required fields\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.success).to.exist;","  pm.expect(responseData.message).to.exist;","  pm.expect(responseData.token).to.exist;","  pm.expect(responseData.user).to.exist;","});","","","pm.test(\"Token is a non-empty string\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData.token).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Token should not be empty\");","});","","","pm.test(\"User ID is a non-negative integer\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.user).to.exist;","  pm.expect(responseData.user.id).to.be.a('number');","  pm.expect(responseData.user.id).to.be.at.least(0);","});","","","pm.test(\"Email is in a valid format\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.user.email).to.exist.and.to.match(/^[\\w-]+(\\.[\\w-]+)*@([\\w-]+\\.)+[a-zA-Z]{2,7}$/);","});"],"type":"text/javascript"}}],"id":"63498c48-4878-4ab0-8622-83ca395e414a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaidriyaz@gmail.com\",\r\n    \"password\": \"12345678\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/login","urlObject":{"protocol":"http","port":"4000","path":["api","auth","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0dce33ea-f5b1-46e4-b303-e35b0c29c2d9","name":"Login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaid@gmail.com\",\r\n    \"password\": \"12345678\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"453"},{"key":"ETag","value":"W/\"1c5-t/EQEHWm7qeAtTkIhyZdDDdZnOs\""},{"key":"Date","value":"Sun, 18 Feb 2024 18:10:39 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"User login successfully!\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiZW1haWwiOiJhYnVzYWlkQGdtYWlsLmNvbSIsImlhdCI6MTcwODI3OTgzOSwiZXhwIjoxNzA4MzY2MjM5fQ.AJt6vm_0dH__7ORDYjDgkCkW7FYbrbH1hZwvHUUbcx0\",\n    \"user\": {\n        \"id\": 3,\n        \"createdAt\": \"2024-02-18T17:45:57.721Z\",\n        \"updatedAt\": \"2024-02-18T17:45:57.721Z\",\n        \"name\": \"Abu Said\",\n        \"email\": \"abusaid@gmail.com\",\n        \"password\": \"$2b$10$R90zb2lKI7lRg7Trs5oSluk7LhddtGm0FlBr0wS5vP3dtDRCQzhSq\"\n    }\n}"}],"_postman_id":"63498c48-4878-4ab0-8622-83ca395e414a"},{"name":"Forgot password","id":"0c453de0-c5bc-4427-8073-04ebf3f0fd41","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaidriyaz@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/forgot-password","urlObject":{"protocol":"http","port":"4000","path":["api","auth","forgot-password"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"55c5c7e6-924e-4288-93eb-ffdf0b8a42b0","name":"Forgot password","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaidriyaz@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/forgot-password"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"99"},{"key":"Date","value":"Thu, 22 Feb 2024 08:42:42 GMT"},{"key":"X-RateLimit-Reset","value":"1708591423"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"100"},{"key":"ETag","value":"W/\"64-MRknfCirFXvIEL6ZTmJuy6nWCXg\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"url\": \"http://localhost:4000/api/auth/confirm/9e1101b2-a554-4d69-8777-353d69b954aa\"\n}"}],"_postman_id":"0c453de0-c5bc-4427-8073-04ebf3f0fd41"},{"name":"Confirm link","id":"382d5231-5461-494f-81f9-f6e9d89f2c91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaidriyaz@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/confirm/9e1101b2-a554-4d69-8777-353d69b954aa","urlObject":{"protocol":"http","port":"4000","path":["api","auth","confirm","9e1101b2-a554-4d69-8777-353d69b954aa"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"adb1b6b1-cac6-4804-b354-578b5ca56838","name":"Confirm link","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"abusaidriyaz@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/auth/confirm/9e1101b2-a554-4d69-8777-353d69b954aa"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"98"},{"key":"Date","value":"Thu, 22 Feb 2024 08:42:54 GMT"},{"key":"X-RateLimit-Reset","value":"1708591423"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"69"},{"key":"ETag","value":"W/\"45-b9JQc37ymCLlE0b9MhXvF24wLgI\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"userId\": \"1\",\n    \"message\": \"Link verified successfully!\"\n}"}],"_postman_id":"382d5231-5461-494f-81f9-f6e9d89f2c91"}],"id":"b5587c3d-0709-4f2e-b26d-c692dc7a1038","_postman_id":"b5587c3d-0709-4f2e-b26d-c692dc7a1038","description":""},{"name":"Posts","item":[{"name":"Get All Post","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Response has the required fields\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData).to.have.property('success');","  pm.expect(responseData).to.have.property('data');","  pm.expect(responseData).to.have.property('pagination');","});","","","pm.test(\"Validate pagination fields\", function(){","  const responseData = pm.response.json();","  ","  pm.expect(responseData.pagination).to.exist.and.to.be.an('object');","  pm.expect(responseData.pagination.currentPage).to.exist.and.to.be.a('number').and.to.be.greaterThan(-1);","  pm.expect(responseData.pagination.totalPages).to.exist.and.to.be.a('number').and.to.be.greaterThan(-1);","  pm.expect(responseData.pagination.totalIPost).to.exist.and.to.be.a('number').and.to.be.greaterThan(-1);","});"],"type":"text/javascript"}}],"id":"38e2dd70-7cc2-4966-8d5a-df88e13b3cb0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/posts?search=my&limit=10&page=1","urlObject":{"protocol":"http","port":"4000","path":["api","posts"],"host":["localhost"],"query":[{"key":"search","value":"my"},{"key":"limit","value":"10"},{"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"e7ed7430-391f-46b4-8c3a-034b5d21fede","name":"Get All Post","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:4000/api/posts?search=my&limit=10&page=1","protocol":"http","host":["localhost"],"port":"4000","path":["api","posts"],"query":[{"key":"search","value":"my"},{"key":"limit","value":"10"},{"key":"page","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"98"},{"key":"Date","value":"Thu, 22 Feb 2024 03:51:54 GMT"},{"key":"X-RateLimit-Reset","value":"1708573959"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"462"},{"key":"ETag","value":"W/\"1ce-ZP19lv5Hg/5A63xEZY2eidzpDv4\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 1,\n            \"title\": \"This is my first blog updated\",\n            \"content\": \"test post updated\",\n            \"author_id\": 1,\n            \"created_at\": \"2024-02-19T16:53:07.294Z\",\n            \"updated_at\": \"2024-02-19T16:53:07.294Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 3,\n            \"title\": \"This is my another blog\",\n            \"content\": \"lorem ipsum\",\n            \"author_id\": 2,\n            \"created_at\": \"2024-02-19T17:18:12.404Z\",\n            \"updated_at\": \"2024-02-19T17:18:12.404Z\",\n            \"author\": \"abu said\"\n        }\n    ],\n    \"pagination\": {\n        \"currentPage\": \"1\",\n        \"totalPages\": 1,\n        \"totalIPost\": 2\n    }\n}"}],"_postman_id":"38e2dd70-7cc2-4966-8d5a-df88e13b3cb0"},{"name":"Get All Post For a user","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Response has required fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.success).to.exist;","  pm.expect(responseData.data).to.exist;","  pm.expect(responseData.pagination).to.exist;","});","","","pm.test(\"Verify that the 'data' array is present and contains at least one element\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.data).to.exist.and.to.be.an('array');","  pm.expect(responseData.data.length).to.be.at.least(1);","});","","","pm.test(\"Verify that the pagination object has the expected fields\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.pagination).to.exist.and.to.be.an('object');","    pm.expect(responseData.pagination.currentPage).to.exist.and.to.be.a('string');","    pm.expect(responseData.pagination.totalPages).to.exist.and.to.be.a('number');","    pm.expect(responseData.pagination.totalIPost).to.exist.and.to.be.a('number');","});"],"type":"text/javascript"}}],"id":"447c2ff3-06d0-4e10-9230-1b1bc54c9800","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:4000/api/posts/me?search=my&limit=10&page=1","urlObject":{"protocol":"http","port":"4000","path":["api","posts","me"],"host":["localhost"],"query":[{"key":"search","value":"my"},{"key":"limit","value":"10"},{"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"ad899115-6932-4ca5-b640-862ea09f1ddd","name":"Get All Post For a user","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:4000/api/posts/me?search=my&limit=10&page=1","protocol":"http","host":["localhost"],"port":"4000","path":["api","posts","me"],"query":[{"key":"search","value":"my"},{"key":"limit","value":"10"},{"key":"page","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"97"},{"key":"Date","value":"Thu, 22 Feb 2024 03:52:03 GMT"},{"key":"X-RateLimit-Reset","value":"1708573959"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"281"},{"key":"ETag","value":"W/\"119-SDj5ihMzFB01/tmmBex0AD+w00Y\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 1,\n            \"title\": \"This is my first blog updated\",\n            \"content\": \"test post updated\",\n            \"author_id\": 1,\n            \"created_at\": \"2024-02-19T16:53:07.294Z\",\n            \"updated_at\": \"2024-02-19T16:53:07.294Z\",\n            \"author\": \"Abu Said\"\n        }\n    ],\n    \"pagination\": {\n        \"currentPage\": \"1\",\n        \"totalPages\": 1,\n        \"totalIPost\": 1\n    }\n}"}],"_postman_id":"447c2ff3-06d0-4e10-9230-1b1bc54c9800"},{"name":"Create a new post","event":[{"listen":"test","script":{"id":"af67e087-6322-47ed-84f0-a456a292d45b","exec":["pm.test(\"Response status code is 201\", function () {","  pm.response.to.have.status(201);","});","","","pm.test(\"Verify that the 'success' field is set to true\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.success).to.be.true;","});","","","pm.test(\"Verify that the 'data' field is an object\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.data).to.be.an('object');","});","","","pm.test(\"Verify that the 'message' field is an empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.equal(\"\");","});"],"type":"text/javascript"}}],"id":"36f785c4-10c2-4347-9ae6-fedf0f7a3434","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"This is my another blog\",\r\n    \"content\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error repellat molestias, quas nam dolores libero ipsa quibusdam temporibus dignissimos quae quia itaque possimus sint laboriosam nemo, minus reprehenderit ratione explicabo.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/create","urlObject":{"protocol":"http","port":"4000","path":["api","posts","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"c22f472c-f770-43d9-a46f-cce47fabc030","name":"Create a new post","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"This is my another blog\",\r\n    \"content\": \"lorem ipsum\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/create"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"96"},{"key":"Date","value":"Thu, 22 Feb 2024 03:52:12 GMT"},{"key":"X-RateLimit-Reset","value":"1708573959"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"228"},{"key":"ETag","value":"W/\"e4-s4SDWBhUJYxnSUKsx6XjRxJPsnw\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 10,\n        \"title\": \"This is my another blog\",\n        \"content\": \"lorem ipsum\",\n        \"author_id\": 1,\n        \"created_at\": \"2024-02-22T03:52:12.634Z\",\n        \"updated_at\": \"2024-02-22T03:52:12.634Z\"\n    },\n    \"message\": \"New post created successfully!\"\n}"}],"_postman_id":"36f785c4-10c2-4347-9ae6-fedf0f7a3434"},{"name":"Update a post","event":[{"listen":"test","script":{"id":"1e709d32-7c7c-4ddc-b950-73502929bcfb","exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Response has the required fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.id).to.exist;","  pm.expect(responseData.title).to.exist;","  pm.expect(responseData.content).to.exist;","  pm.expect(responseData.author_id).to.exist;","  pm.expect(responseData.created_at).to.exist;","  pm.expect(responseData.updated_at).to.exist;","});","","","pm.test(\"Verify that the 'success' field is true\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.success).to.be.true;","});","","","pm.test(\"Verify that the 'message' field is empty\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.equal(\"\");","});","","","pm.test(\"Validate that the title field is a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data.title).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Title should not be empty\");","});"],"type":"text/javascript"}}],"id":"faed181b-777f-475a-945d-98ff6c35ac61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"This is my second blog updated\",\r\n    \"content\": \"Lorem ipsum dolor sit amet consectetur adipisicing elit. Error repellat molestias, quas nam dolores libero ipsa quibusdam temporibus dignissimos quae quia itaque possimus sint laboriosam nemo, minus reprehenderit ratione explicabo.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/update/1","urlObject":{"protocol":"http","port":"4000","path":["api","posts","update","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9fc2b5be-d020-490d-9021-865585ec622c","name":"Update a post","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"This is my first blog updated\",\r\n    \"content\": \"lorem ipsum\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/update/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"95"},{"key":"Date","value":"Thu, 22 Feb 2024 03:52:21 GMT"},{"key":"X-RateLimit-Reset","value":"1708573959"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"229"},{"key":"ETag","value":"W/\"e5-2A2SQbZ+KsclmCw80u7pW3P+xnU\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 1,\n        \"title\": \"This is my first blog updated\",\n        \"content\": \"lorem ipsum\",\n        \"author_id\": 1,\n        \"created_at\": \"2024-02-19T16:53:07.294Z\",\n        \"updated_at\": \"2024-02-19T16:53:07.294Z\"\n    },\n    \"message\": \"Post updated successfully!\"\n}"}],"_postman_id":"faed181b-777f-475a-945d-98ff6c35ac61"},{"name":"Delete a post","event":[{"listen":"test","script":{"id":"e3a135d0-eb2b-4da7-a68e-df72de944abc","exec":["pm.test(\"Response status code is 404\", function () {","  pm.expect(pm.response.code).to.equal(404);","});","","","pm.test(\"Validate that the response has the 'success' field\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.success).to.exist;","});","","","pm.test(\"Validate that the 'success' field is true\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.success).to.be.true;","});","","","pm.test(\"Validate that the response has the 'message' field\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.exist;","});","","","pm.test(\"Validate that the 'message' field is empty\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.equal(\"\");","});"],"type":"text/javascript"}}],"id":"706d4108-776f-4b82-9a8f-1e0617a6b115","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/delete/2","urlObject":{"protocol":"http","port":"4000","path":["api","posts","delete","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"ca24d5e8-217c-401c-b7b6-d1a4982888b4","name":"Delete a post","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/posts/delete/10"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"98"},{"key":"Date","value":"Thu, 22 Feb 2024 03:52:50 GMT"},{"key":"X-RateLimit-Reset","value":"1708574023"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"224"},{"key":"ETag","value":"W/\"e0-WTZwqMuluqgSsk1/wLAxqFRVkVM\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 10,\n        \"title\": \"This is my another blog\",\n        \"content\": \"lorem ipsum\",\n        \"author_id\": 1,\n        \"created_at\": \"2024-02-22T03:52:12.634Z\",\n        \"updated_at\": \"2024-02-22T03:52:12.634Z\"\n    },\n    \"message\": \"Post deleted successfully!\"\n}"}],"_postman_id":"706d4108-776f-4b82-9a8f-1e0617a6b115"},{"name":"Get a post details by id","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Response has the required fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.id).to.exist;","  pm.expect(responseData.title).to.exist;","  pm.expect(responseData.content).to.exist;","  pm.expect(responseData.author_id).to.exist;","  pm.expect(responseData.created_at).to.exist;","  pm.expect(responseData.updated_at).to.exist;","  pm.expect(responseData.author).to.exist;","});","","","pm.test(\"Title is a non-empty string\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.data.title).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Title should not be empty\");","});","","","pm.test(\"Author_id is a non-negative integer\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.data.author_id).to.be.a('number').that.is.at.least(0);","});","","","pm.test(\"Created_at is in a valid date format\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.data).to.be.an('object');","    pm.expect(responseData.data.created_at).to.match(/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$/, \"Created_at should be in the format YYYY-MM-DD HH:MM:SS\");","});"],"type":"text/javascript"}}],"id":"20388769-f916-4997-aa20-0185bac77fcf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:4000/api/posts/view/1","urlObject":{"protocol":"http","port":"4000","path":["api","posts","view","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6ad78768-be97-4008-bbf1-76448dcd1286","name":"Get a post details by id","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/posts/view/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"97"},{"key":"Date","value":"Thu, 22 Feb 2024 03:53:01 GMT"},{"key":"X-RateLimit-Reset","value":"1708574023"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"210"},{"key":"ETag","value":"W/\"d2-8/nVS93O56+grfkgr9SggK425Xo\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 1,\n        \"title\": \"This is my first blog updated\",\n        \"content\": \"lorem ipsum\",\n        \"author_id\": 1,\n        \"created_at\": \"2024-02-19T16:53:07.294Z\",\n        \"updated_at\": \"2024-02-19T16:53:07.294Z\",\n        \"author\": \"Abu Said\"\n    }\n}"}],"_postman_id":"20388769-f916-4997-aa20-0185bac77fcf"}],"id":"aa468f62-f98e-4501-8d0a-e71c35c4263f","_postman_id":"aa468f62-f98e-4501-8d0a-e71c35c4263f","description":""},{"name":"Comments","item":[{"name":"Get All comment for a post by post id","event":[{"listen":"test","script":{"id":"2d5f81b5-6a0a-4973-9870-976c08484fd3","exec":["pm.test(\"Response status code is 200\", function () {","  pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Content-Type is application/json\", function () {","    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});","","","pm.test(\"Validate the 'success' field is true\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.success).to.be.true;","});","","","pm.test(\"Verify that the 'data' array is present and contains the expected number of elements\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.data).to.exist.and.to.be.an('array');","    pm.expect(responseData.data.length).to.equal(1);","});"],"type":"text/javascript"}}],"id":"83cd57f6-a433-49f6-8753-2332d995ff07","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/comments/1","urlObject":{"protocol":"http","port":"4000","path":["api","comments","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"a88e8002-09dc-4ef5-93a5-0ab99629ba7c","name":"Get All comment for a post by post id","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/comments/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"96"},{"key":"Date","value":"Thu, 22 Feb 2024 03:53:19 GMT"},{"key":"X-RateLimit-Reset","value":"1708574023"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1692"},{"key":"ETag","value":"W/\"69c-Zs4O4A/hzX52sj4QJOzgSCvJ3XQ\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 3,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:09:47.266Z\",\n            \"updated_at\": \"2024-02-21T14:09:47.266Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 5,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:13:25.134Z\",\n            \"updated_at\": \"2024-02-21T14:13:25.134Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 7,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:14:38.016Z\",\n            \"updated_at\": \"2024-02-21T14:14:38.016Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 4,\n            \"content\": \"test comment\",\n            \"author_id\": 2,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:10:19.201Z\",\n            \"updated_at\": \"2024-02-21T14:10:19.201Z\",\n            \"author\": \"abu said\"\n        },\n        {\n            \"id\": 9,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:20:47.677Z\",\n            \"updated_at\": \"2024-02-21T14:20:47.677Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 10,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:21:31.228Z\",\n            \"updated_at\": \"2024-02-21T14:21:31.228Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 11,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:23:18.063Z\",\n            \"updated_at\": \"2024-02-21T14:23:18.063Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 12,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:23:48.159Z\",\n            \"updated_at\": \"2024-02-21T14:23:48.159Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 13,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:25:26.452Z\",\n            \"updated_at\": \"2024-02-21T14:25:26.452Z\",\n            \"author\": \"Abu Said\"\n        },\n        {\n            \"id\": 14,\n            \"content\": \"test comment\",\n            \"author_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-21T14:26:23.299Z\",\n            \"updated_at\": \"2024-02-21T14:26:23.299Z\",\n            \"author\": \"Abu Said\"\n        }\n    ],\n    \"pagination\": {\n        \"currentPage\": 1,\n        \"totalPages\": 1,\n        \"totalIPost\": 10\n    }\n}"}],"_postman_id":"83cd57f6-a433-49f6-8753-2332d995ff07"},{"name":"Add new comment in a post","event":[{"listen":"test","script":{"id":"a778e5b5-bfb5-4702-b7ce-9e6bbe8860c4","exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Response has required fields - success and data\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.success).to.exist;","    pm.expect(responseData.data).to.exist;","});","","","pm.test(\"The 'id' field in the data object is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.data).to.exist;","    pm.expect(responseData.data.id).to.be.a('number');","    pm.expect(responseData.data.id).to.be.at.least(0);","});","","","pm.test(\"The 'content' field in the data object is a non-empty string\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.data).to.be.an('object');","    pm.expect(responseData.data.content).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Value should not be empty\");","});","","","pm.test(\"Validate author_id and post_id fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.data).to.be.an('object');","  pm.expect(responseData.data.author_id).to.be.a('number').and.to.be.at.least(0, \"author_id should be a non-negative integer\");","  pm.expect(responseData.data.post_id).to.be.a('number').and.to.be.at.least(0, \"post_id should be a non-negative integer\");","});"],"type":"text/javascript"}}],"id":"364ee0ca-dfd6-4c7c-a73b-58ffe7006a2e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 1,\r\n    \"content\": \"I think this is especially important. You will start to work on a project with a tech stack of your choosing, and a week later, you will hear about how that tech is bad and that you should switch to a new one. A week later, you will hear about how that one is bad, and you should switch to a third one, and so on... Remember that the tech is not as important as your skill. Much of the obtained knowledge can and will be transferable to other projects regardless of the tech.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/create","urlObject":{"protocol":"http","port":"4000","path":["api","comments","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"87f027b1-6091-44f5-a0fa-df7e0386a41c","name":"Add new comment in a post","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 3,\r\n    \"content\": \"This is my comment\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"95"},{"key":"Date","value":"Thu, 22 Feb 2024 03:53:28 GMT"},{"key":"X-RateLimit-Reset","value":"1708574023"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"170"},{"key":"ETag","value":"W/\"aa-AOmWRmvkmWbJEbqGHctVOe2YY+A\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 32,\n        \"content\": \"This is my comment\",\n        \"author_id\": 1,\n        \"post_id\": 3,\n        \"created_at\": \"2024-02-22T03:53:28.064Z\",\n        \"updated_at\": \"2024-02-22T03:53:28.064Z\"\n    }\n}"}],"_postman_id":"364ee0ca-dfd6-4c7c-a73b-58ffe7006a2e"},{"name":"Update a comment content by id","event":[{"listen":"test","script":{"id":"fa9cd7e5-98de-4ff6-b99b-028770412fa2","exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Content is a non-empty string\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData.data.content).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Value should not be empty\");","});","","","pm.test(\"Author_id should be a non-negative integer\", function () {","    const responseData = pm.response.json();","  ","    pm.expect(responseData.data.author_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.data.author_id).to.be.at.least(0);","});"],"type":"text/javascript"}}],"id":"34bbb44d-cd14-4a4f-8e65-4ca670e8bb1b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"content\": \"This is my comment updated\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/update/1","urlObject":{"protocol":"http","port":"4000","path":["api","comments","update","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"b7417cd6-a30e-4eb1-a45e-162c58b3d7d0","name":"Update a comment content by id","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"content\": \"This is my comment updated\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/update/3"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"98"},{"key":"Date","value":"Thu, 22 Feb 2024 03:55:27 GMT"},{"key":"X-RateLimit-Reset","value":"1708574184"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"219"},{"key":"ETag","value":"W/\"db-ge/0T+SSogcAgjww17peeKmn5fw\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 3,\n        \"content\": \"This is my comment updated\",\n        \"author_id\": 1,\n        \"post_id\": 1,\n        \"created_at\": \"2024-02-21T14:09:47.266Z\",\n        \"updated_at\": \"2024-02-21T14:09:47.266Z\"\n    },\n    \"message\": \"Comment updated successfully!\"\n}"}],"_postman_id":"34bbb44d-cd14-4a4f-8e65-4ca670e8bb1b"},{"name":"Delete a comment content by id","event":[{"listen":"test","script":{"exec":["pm.test(\"Response status code is 404\", function () {","  pm.expect(pm.response.code).to.equal(404);","});","","","pm.test(\"Response has the 'success' field\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.success).to.exist;","});","","","pm.test(\"The 'success' field should be a boolean value\", function() {","  const responseData = pm.response.json();","","  pm.expect(responseData.success).to.be.a('boolean');","});","","","pm.test(\"The 'message' field is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.message).to.exist.and.to.be.a('string').and.to.have.lengthOf.at.least(1, \"Value should not be empty\");","});","","","pm.test(\"Validate that the 'message' field is empty\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.message).to.be.empty;","});"],"type":"text/javascript"}}],"id":"1443652d-c75d-4d91-92fd-b99dec770740","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/delete/15","urlObject":{"protocol":"http","port":"4000","path":["api","comments","delete","15"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"ec787358-3d5b-4b3b-ae63-0a7fcc5fd75a","name":"Delete a comment content by id","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/comments/delete/15"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"96"},{"key":"Date","value":"Thu, 22 Feb 2024 03:55:55 GMT"},{"key":"X-RateLimit-Reset","value":"1708574184"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"206"},{"key":"ETag","value":"W/\"ce-RPdrWwUGM6ZygOAYSSu9JAOxy7k\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 15,\n        \"content\": \"test comment\",\n        \"author_id\": 1,\n        \"post_id\": 1,\n        \"created_at\": \"2024-02-21T14:26:47.963Z\",\n        \"updated_at\": \"2024-02-21T14:26:47.963Z\"\n    },\n    \"message\": \"Comment deleted successfully!\"\n}"}],"_postman_id":"1443652d-c75d-4d91-92fd-b99dec770740"}],"id":"e6baafb5-a267-4f96-a174-cd70e8351ddd","_postman_id":"e6baafb5-a267-4f96-a174-cd70e8351ddd","description":""},{"name":"Post Reactions","item":[{"name":"Post Reaction","event":[{"listen":"test","script":{"id":"c5ae2544-d22e-450a-9474-78999d4e68b2","exec":["pm.test(\"Response status code is 200\", function () {","  pm.response.to.have.status(200);","});","","","pm.test(\"Response has the required fields - success and reaction\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData).to.be.an('object');","  pm.expect(responseData.success).to.exist;","  pm.expect(responseData.reaction).to.exist;","});","","","pm.test(\"Success field is a boolean\", function () {","  const responseData = pm.response.json();","","  pm.expect(responseData.success).to.be.a('boolean');","});","","","pm.test(\"Reaction field is a boolean\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.reaction).to.be.a('boolean');","});","","","pm.test(\"Content-Type header is set to application/json\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\")).to.equal(\"application/json\");","});"],"type":"text/javascript"}}],"id":"86bf0626-82ad-4ab0-a1be-5de96a0f175d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 2\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/reactions","urlObject":{"protocol":"http","port":"4000","path":["api","reactions"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"41de40bc-9b2c-47d3-98a6-f66d9f74477b","name":"Post Reaction","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/reactions"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"95"},{"key":"Date","value":"Thu, 22 Feb 2024 03:56:20 GMT"},{"key":"X-RateLimit-Reset","value":"1708574184"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"33"},{"key":"ETag","value":"W/\"21-e8O5WewHGBEHOMpcscu8XU8ED0E\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"reaction\": false\n}"},{"id":"0708ac96-9d04-4fb3-a1dc-8a149bad515f","name":"Post Reaction","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/reactions"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"98"},{"key":"Date","value":"Thu, 22 Feb 2024 03:56:35 GMT"},{"key":"X-RateLimit-Reset","value":"1708574250"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"32"},{"key":"ETag","value":"W/\"20-tAjDNeLrefj9D6Z3EOH5cHnXhcw\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"reaction\": true\n}"}],"_postman_id":"86bf0626-82ad-4ab0-a1be-5de96a0f175d"},{"name":"Get All Reaction in a post by post id","event":[{"listen":"test","script":{"id":"8b90ca7d-02ae-459a-8abc-e8a43c67fd29","exec":["pm.test(\"Response status code is 200\", function () {","    pm.expect(pm.response.code).to.equal(200);","});","","","pm.test(\"Response has the required fields\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.success).to.exist;","  pm.expect(responseData.reactions).to.exist;","  pm.expect(responseData.totalReaction).to.exist;","});","","","pm.test(\"Reactions array should be empty\", function () {","    const responseData = pm.response.json();","","    pm.expect(responseData.reactions).to.be.an('array').that.is.empty;","});","","","pm.test(\"TotalReaction is a non-negative integer\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData.totalReaction).to.be.a('number');","    pm.expect(responseData.totalReaction).to.be.at.least(0);","});","","","pm.test(\"Content-Type is application/json\", function () {","  pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");","});"],"type":"text/javascript"}}],"id":"3e6b69c7-d248-4431-b407-b125c934b2bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/reactions/2","urlObject":{"protocol":"http","port":"4000","path":["api","reactions","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"706b24da-a2ec-4739-b3ac-3bd0dc119579","name":"Get All Reaction in a post by post id","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"post_id\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/reactions/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"97"},{"key":"Date","value":"Thu, 22 Feb 2024 03:56:45 GMT"},{"key":"X-RateLimit-Reset","value":"1708574250"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"180"},{"key":"ETag","value":"W/\"b4-FqpEFETMRAmZJL75hJWBiobov+o\""},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"reactions\": [\n        {\n            \"id\": 27,\n            \"user_id\": 1,\n            \"post_id\": 1,\n            \"created_at\": \"2024-02-22T03:56:35.930Z\",\n            \"updated_at\": \"2024-02-22T03:56:35.930Z\",\n            \"user\": \"Abu Said\"\n        }\n    ],\n    \"totalReaction\": 1\n}"}],"_postman_id":"3e6b69c7-d248-4431-b407-b125c934b2bb"}],"id":"9fc782ea-5000-4297-9305-0836c58f4b7e","_postman_id":"9fc782ea-5000-4297-9305-0836c58f4b7e","description":""}],"event":[{"listen":"prerequest","script":{"id":"7cf591ad-efa4-423b-a93a-24d1bac3a278","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"bfb1b512-a2b1-44a2-836f-445decedac93","type":"text/javascript","exec":[""]}}],"variable":[{"key":"token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJhYnVzYWlkcml5YXpAZ21haWwuY29tIiwiaWF0IjoxNzA4NTc1NTQyLCJleHAiOjE3MDg2NjE5NDJ9.EHJJaBR9-cCRt4_zc6cneIj7QiUF4ODEWoJ4Rodi28E","type":"string"}]}